<template>
  <div style="height: 100%; width: 100%; position: relative">
      <!-- 顶部查询窗口 -->
      <div class="pagetop" :style="'height:' + topheight + 'px;'" ref="topwindow">
          <template>
              <div>
                  <div style="float: left; width: 100%">
                      <table style="white-space:nowrap;">
                          <tr>
                              <td width="40px">日期</td>
                              <td>
                                  <el-date-picker v-model="queryDate[0]" type="date" placeholder="开始日期" value-format="yyyy-MM-dd" @change="queryDate_change" style="width: 130px" :clearable="false"></el-date-picker> ~
                                  <el-date-picker v-model="queryDate[1]" type="date" placeholder="结束日期" value-format="yyyy-MM-dd" @change="queryDate_change" style="width: 130px" :clearable="false"></el-date-picker>
                              </td>
                              <!-- <td v-if="true">
                              <td>
                              <td v-if="true">
                              <td> -->
                              <td width="60px">检验仪器</td>
                              <td>
                                  <rm-ddl-instrument @change="yq_change" width="202px" v-model="instrId" defaultflag="1" prgno="LIS532" :clearable="false" :bPower="true"></rm-ddl-instrument>
                              </td>
                              <!-- <td width="10px"></td> -->
                              <td align="right" style="text-align: left;padding: 0px 15px;">
                                  <!-- <el-radiio v-model="allbatch" style="padding: 0px 15px" size="mini" @change="allbatch_change"> -->
                                  <el-radio v-model="allbatch" label="0" @change="allbatch_change">单批号</el-radio>
                                  <el-radio v-model="allbatch" label="1" @change="allbatch_change">不分批号</el-radio>
                                  <el-radio v-model="allbatch" label="2" @change="allbatch_change">批号多选</el-radio>
                                  <!-- </el-radio> -->

                                  <!-- <el-checkbox style="margin: 0px 5px;" v-model="multi" true-label="1" false-label="0">多图</el-checkbox>

                                  <el-checkbox style="margin: 0px 5px;" v-model="showother" true-label="1" false-label="0">显示非累计点</el-checkbox> -->
                              </td>
                              <td>
                                  <el-checkbox v-model="showallbatch" size="mini" true-label="1" false-label="0" @change="queryDate_change">显示所有批号</el-checkbox>
                              </td>
                          </tr>
                          <tr>
                              <td align="left" colspan="4">
                                  <el-checkbox-group v-model="queryQclevel" size="mini" style="text-align: left;padding-left:15px" :max="3">
                                      <el-checkbox style="min-width:35px" @change="qclevel_change" v-for="(qclevel, index) in queryQclevels" :key="index" :label="qclevel.label" :disabled="setQclevelDisabled(qclevel)">{{ qclevel.label }}</el-checkbox>
                                  </el-checkbox-group>
                              </td>
                              <!-- <td width="10px"></td> -->
                              <!-- <td></td> -->
                              <!-- <td width="60px">医院</td>
                              <td>
                                  <rm-ddl-common @change="hospitalchange" datatype="hospital" dataname="医院" v-model="hospitalval" width="200px"></rm-ddl-common>
                              </td> -->
                              <td colspan="1" style="text-align: left;padding: 0px 15px;">
                                  <!-- <el-radio-group v-model="gtype" @change="getTableDataShow" size="mini"> -->
                                  <el-radio v-model="gtype" label="0" @change="getTableDataShow">所有点</el-radio>
                                  <el-radio style="width:67px" v-model="gtype" label="1" @change="getTableDataShow">最后点</el-radio>
                                  <el-radio v-model="gtype" label="2" @change="getTableDataShow">最好点</el-radio>
                                  <!-- </el-radio-group> -->
                              </td>
                              <td :colspan="2" style="text-align: right">
                                  <el-button style="margin: 0px 0px 0px 0px" icon="el-icon-search" @click="getData()" v-has="'PINQUERY'">刷新</el-button>
                              </td>
                          </tr>
                      </table>
                  </div>
              </div>
          </template>
      </div>
      <!-- 上方分隔条 -->
      <div class="xsplit" :style="'top:' + topheight + 'px;'" @mousedown="xtopmousedown"></div>
      <!-- 主画面 -->
      <div class="pagecenter" :style="'top:' + (topheight + 5) + 'px;bottom:' + (bottomheight + 5) + 'px;'">
          <!-- 左边list列表 -->
          <div class="middle-center" :style="'left:' + leftwidth + 'px;right:' + (rightwidth + 5) + 'px;'" id="leftGrid">
              <vxe-table v-if="allbatch != '1'" ref="xTableB" width="100%" :height="com_batchWindowHeight" style="margin: 0px 0px 3px 0px" :select-config="{ reserve: true }" :data.sync="tableDataBatch" border size="mini" :mouse-config="{ selected: true }" show-header-overflow highlight-current-row highlight-hover-row resizable stripe @current-change="batch_change" @select-change="batch_selectChange" @select-all="batch_selectChange" :sort-config="{ trigger: 'cell' }">
                  <vxe-table-column v-if="allbatch == '2'" type="selection" width="30" align="center"></vxe-table-column>
                  <vxe-table-column field="batchno" title="批号" width="50%" align="center" sortable></vxe-table-column>
                  <vxe-table-column field="maxstartdt" title="启用日期" width="40%" header-align="center" :formatter="['toDateString', 'yyyy-MM-dd']" sortable></vxe-table-column>
              </vxe-table>

              <vxe-table ref="xTableR" width="100%" :height="com_rptitemHeight" :select-config="{ reserve: true }" :data.sync="tableDataRptitem" border size="mini" :keyboard-config="keyConfig" :mouse-config="{ selected: true }" show-header-overflow highlight-current-row highlight-hover-row resizable stripe :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true }" @current-change="rptitem_change">
                  <vxe-table-column field="itemcode_en" title="项目编号" width="40%" header-align="center"></vxe-table-column>
                  <vxe-table-column field="showname" title="项目名称" width="60%" header-align="center">
                  </vxe-table-column>
              </vxe-table>
          </div>
          <!-- 右边分割条 -->
          <div class="ysplit" :style="'right:' + rightwidth + 'px;'" @mousedown="yrightmousedown"></div>
          <!-- 右边数据展现tab -->
          <div class="middle-right" :style="'width:' + rightwidth + 'px;'">
              <el-tabs style="height: 100%" type="border-card" v-model="tabsValue" @tab-click="tab_changed" ref="lis532righttab">
                  <el-tab-pane label="图形">
                      <div style="width: 100%; height: 75%; ">
                          <rm-layout-left splitcolor="#ffffff" style="height:100%" :splitwidth="5" :fixsize="250" :minfixsize="250" :maxfixsize="250">
                              <template v-slot:fix>
                                  <div class="tabtop" style="width:100%;">
                                      <div class="tab-title">列表
                                      </div>
                                  </div>
                                  <div class="left_nav">
                                      <div v-for="(titem, tindex) in nArray" :class="currentIndex == tindex? 'active' : ''" :key="tindex" @click="goAnchor(tindex)">
                                          {{ titem.title }}
                                      </div>
                                  </div>
                              </template>
                              <div class="tabtop" style="width:100%;">
                                  <div class="tab-title">Youden图
                                  </div>
                              </div>
                              <div class="right_content" ref="ScrollMainContent">
                                  <!--主体-->
                                  <div style="height:100%">
                                      <!--标题-->
                                      <div :id="'anchor-0' " class="scroll_title">
                                          <div style="height:10%;width:100%"> {{ currenttitle }}</div>
                                      </div>
                                      <div :id="'lis532Chart-0'" style="height:90%;width:100%"></div>
                                      <!-- <div :id="'qcChart'" style="height:90%;width:100%"></div> -->
                                      <!-- <div v-for="(titem, tindex) in nArray" :key="tindex" style="height:100%">
                                 
                                          <div :id="'anchor-' + tindex" class="scroll_title" :class="{isActive: currentIndex == tindex}">
                                              <div style="height:10%;width:100%"> {{ titem.title }}</div>
                                          </div>
                                          <div :id="'lis532Chart-'+ tindex" style="height:90%;width:100%"></div>
                          
                                      </div> -->
                                  </div>
                              </div>
                          </rm-layout-left>
                      </div>
                      <vxe-table class="basecss" ref="xTableShowLines" width="100%" height="24%" :select-config="{ reserve: true }" :data.sync="tableDataLinesunion" border size="mini" show-header-overflow highlight-current-row highlight-hover-row resizable stripe :cell-class-name="xTableRCellClassName">
                          <vxe-table-column field="lineLevel" title="水平" width="40px" align="center"></vxe-table-column>
                          <vxe-table-column field="lineBatch" title="批号" width="160px" align="center">
                              <template v-slot="{ row }">
                                  <el-input style="print" v-model="row.lineBatch" type="textarea" autosize readonly></el-input>
                              </template>
                          </vxe-table-column>
                          <vxe-table-column field="lineName" title="名称" width="160px" align="center">
                              <template v-slot="{ row }">
                                  <el-input style="print" v-model="row.lineName" type="textarea" autosize readonly></el-input>
                              </template>
                          </vxe-table-column>
                          <vxe-table-column field="lineTagvalue" title="靶值  x̅" width="130px" align="center" v-if="qcrule.qcruletype != '4'">
                              <template v-slot="{ row }">
                                  <el-input style="print" v-model="row.lineTagvalue" type="textarea" autosize readonly></el-input>
                              </template>
                          </vxe-table-column>
                          <vxe-table-column field="lineSd" title="标准差SD" width="140px" align="center" v-if="qcrule.qcruletype != '4'"> <template v-slot="{ row }">
                                  <el-input style="print" v-model="row.lineSd" type="textarea" autosize readonly></el-input>
                              </template></vxe-table-column>
                          <vxe-table-column field="lineCv" title="变异系数CV" width="140px" align="center" v-if="qcrule.qcruletype != '4'"><template v-slot="{ row }">
                                  <el-input style="print" v-model="row.lineCv" type="textarea" autosize readonly></el-input>
                              </template></vxe-table-column>
                          <vxe-table-column field="lineTagvalueunion" title="当前均值" width="70px" align="center" v-if="qcrule.qcruletype != '4'"></vxe-table-column>
                          <vxe-table-column field="lineSdunion" title="当前SD" width="70px" align="center" v-if="qcrule.qcruletype != '4'"></vxe-table-column>
                          <vxe-table-column field="lineCvunion" title="当前CV" width="70px" align="center" v-if="qcrule.qcruletype != '4'"></vxe-table-column>
                          <vxe-table-column field="normallineTagvalueunion" :title="renamecurrentcontrol+'均值'" width="80px" align="center" v-if="qcrule.qcruletype != '4'"></vxe-table-column>
                          <vxe-table-column field="normallineSdunion" :title="renamecurrentcontrol+'SD'" width="80px" align="center" v-if="qcrule.qcruletype != '4'"></vxe-table-column>
                          <vxe-table-column field="normallineCvunion" :title="renamecurrentcontrol+'CV'" width="80px" align="center" v-if="qcrule.qcruletype != '4'"></vxe-table-column>
                          <vxe-table-column field="mnlineTagvalueunion" title="本月去失控均值" width="100px" align="center" v-if="qcrule.qcruletype != '4'&&showmonthincontrol == '1'"></vxe-table-column>
                          <vxe-table-column field="mnlineSdunion" title="本月去失控SD" width="100px" align="center" v-if="qcrule.qcruletype != '4' &&showmonthincontrol == '1'"></vxe-table-column>
                          <vxe-table-column field="mnlineCvunion" title="本月去失控CV" width="100px" align="center" v-if="qcrule.qcruletype != '4'&&showmonthincontrol == '1'"></vxe-table-column>
                          <vxe-table-column field="cumlineTagvalueunion" title="累积去失控均值" width="150px" align="center" v-if="qcrule.qcruletype != '4'&&showcumcontrol == '1'"><template v-slot="{ row }">
                                  <el-input style="print" v-model="row.cumlineTagvalueunion" type="textarea" autosize readonly></el-input>
                              </template></vxe-table-column>
                          <vxe-table-column field="cumlineSdunion" title="累积去失控SD" width="150px" align="center" v-if="qcrule.qcruletype != '4' &&showcumcontrol == '1'">
                              <template v-slot="{ row }">
                                  <el-input style="print" v-model="row.cumlineSdunion" type="textarea" autosize readonly></el-input>
                              </template>
                          </vxe-table-column>
                          <vxe-table-column field="cumlineCvunion" title="累积去失控CV" width="150px" align="center" v-if="qcrule.qcruletype != '4'&&showcumcontrol == '1'">
                              <template v-slot="{ row }">
                                  <el-input style="print" v-model="row.cumlineCvunion" type="textarea" autosize readonly></el-input>
                              </template>
                          </vxe-table-column>
                          <vxe-table-column field="lineExpriedt" title="有效期" width="150px" align="center"><template v-slot="{ row }">
                                  <el-input style="print" v-model="row.lineExpriedt" type="textarea" autosize readonly></el-input>
                              </template>
                          </vxe-table-column>
                          <vxe-table-column field="lineNum" title="数量" width="40px" align="center"></vxe-table-column>
                          <vxe-table-column field="lineComm" title="备注" width="200px" align="center"><template v-slot="{ row }">
                                  <el-input style="print" v-model="row.lineComm" type="textarea" autosize readonly></el-input>
                              </template>
                          </vxe-table-column>
                      </vxe-table>
                  </el-tab-pane>
                  <el-tab-pane label="有效数据">
                      <div align="right" style="width: 100%; padding: 0px 0px 5px 0px; font-size: 12px; height: 26px">
                          <el-button icon="el-icon-printer" @click="btnPrintData('print')" v-has="'PMODIFY'">打印</el-button>
                          <el-button icon="el-icon-edit-outline" @click="btnPrintData('design')" v-has="'PMODIFY'">样式设计</el-button>
                      </div>
                      <div style="width: 100%; overflow: auto; top: 28px; position: absolute; bottom: 0px">
                          <vxe-table ref="xTableShow" width="100%" height="auto" :select-config="{ reserve: true }" :data.sync="tableDataShow" border size="mini" show-header-overflow highlight-current-row highlight-hover-row resizable stripe :key="showDataKey" :cell-class-name="getOutcontrolClassnameShow" :saveCustomColumnData="saveCustomColumnData" :loadCustomColumnData="loadCustomColumnData">
                              <vxe-table-column field="qcdate" title="日期" width="100px" align="center"></vxe-table-column>
                              <vxe-table-column field="seq" title="序号" width="50px" align="center"></vxe-table-column>
                              <template v-for="(item, index) in queryQclevel">
                                  <vxe-table-column :key="'col' + index" :title="item" width="110" sortable align="center">
                                      <vxe-table-column :key="index" :field="'val' + transtQclevel(item)" :title="'测定值'" width="80px" header-align="center" align="right"></vxe-table-column>
                                      <vxe-table-column :key="'index' + index" :field="'sd' + transtQclevel(item)" :title="'  SD'" width="70px" header-align="center" align="right"></vxe-table-column>
                                  </vxe-table-column>
                              </template>
                          </vxe-table>
                      </div>
                  </el-tab-pane>
              </el-tabs>
          </div>
      </div>
  </div>
</template>

<script type="text/javascript">
import XEUtils from "xe-utils"; //引入工具类
import echarts from "echarts"; //引入echarts
import { EleResize } from "../../../common/esresize.js";
// import printJS from "print-js";

XEUtils.mixin({
  // 自定义全局的格式化处理函数
  formatSelect(cellValue, list) {
      let item = list.find((item) => item.value == cellValue);
      return item ? item.label : cellValue;
  },
});
export default {
  name: "LIS532",
  data() {
      return {
          loading: false,
          testmethod: "",
          currenttitle: "",
          xname: "X",
          yname: "Y",
          visualmap: [], //隐藏更换批号/靶值数据之间连线
          tabsValue: "0", //右边标签，选中的标签
          batchno: "", //选择的当前的项目
          fullDataKey: 1, //所有数据标签 强制刷新标记
          showDataKey: 1, //有效数据标签 强制刷新标记
          appraiseDataKey: 1, //有效数据标签 强制刷新标记
          charts: "", //质控图实例1
          charts1: "", //质控图实例2
          charts2: "", //质控图实例3
          echartsAxisInterval: 31, //质控图形上最多显示多少个日期 ，推荐printQcdataLen *3 的数量
          tableDataBatch: [], //批号列表
          tableDataRptitem: [], //项目列表
          showmonthincontrol: "0", //显示本月在控数据标志 
          showcumcontrol: "0", //显示累积在控数据标志
          renamecurrentcontrol: "当前在控", //重命名当前在控列
          rptitemAll: [], //所有项目数据标签中项目下拉列表
          rptitemAllSelect: "", //所有项目数据标签中项目下拉列表
          qclevelAllSelect: "", //所有项目数据标签中水平下拉列表
          qclevelAllEnable: "", //所有项目数据标签中水平Options
          tableDataFull: [], //查询出的全部数据
          monthNormalData: [], //获取当月非失控
          cumNormalData: [], //获取累积非失控
          tableDataAll: [], //所有项目数据标签中的数据
          allDataVisible: "0",
          tableDataShow: [], //有效数据（累计数据或画图数据）
          drawpointData: [], //有效数据 中的画图数据
          tableAppraiseData: [], //质控评价数据
          tableDataLines: [], //线条的显示信息
          tableDataLinesunion: [], //新线条显示信息（合并）
          tableDataPrintQcdata: [], //打印质控图弹窗中，质控数据明细
          tableDataOutcontrol: [], ///打印质控图弹窗中，失控数据列表
          itemjudge: [], //定性质控，画图时Y轴内容
          splitLineColor: [], //画图Y轴线条颜色 
          singlelevelshownum: {}, //单水平单批号时Y轴显示数值， 记录Y轴数值
          slvshownum: "0", //更改为页面选项，如仪器选项勾选了 这边就默认勾选。
          chartData: [], //画图数据
          drawTitleText: "", //画图顶部的说明文
          echartImg: "", //放 echart 的 base64码  <img v-bind:src="echartImg" />
          echartSplitNumber: 8, //Y轴刻度 ，定性质控也用到
          printDialogvisible: false, //打印质控图时 预览弹窗
          printQcKey: 1, //打印质控图时强制刷新
          hospitalname: "", //医院名称
          printQcFilecode: "", //打印时的文件编号
          printQcdataDate: [], //打印弹窗中，数据日期列（暂定最多 printQcdataLen *5 天）  
          printQcdataLen: 15, //打印具体数据为每行15列
          printQcdataRow: 3, //打印具体数据3行
          printQcHeader: [], //打印质控图 Header 区域内容
          printQcFooter: [], //打印质控图 Footer 区域内容
          printQcTilteText: [], //打印质控图 顶部的文字
          printQcEndText: [], //打印质控图 底部的文字
          printInusedata: [], //质控图打印时的线条 累计信息
          printILastmonthdata: [], //质控图打印时的线条 上月信息
          printcheck: 0, //质控图打印显示签名人 美年需求
          //   以下为查询条件
          queryDate: [], //起始结束日期
          bAllSLoading: false,
          datekey: 0, //所有数据日期刷新 
          // starkey1: 0, //所有数据日期刷新
          // endkey2: 0, //所有数据日期刷新
          instrId: 0,
          instrName: "",
          allbatch: "1", //0单批号、1不分批号、2批号多选
          showallbatch: "0", //显示所有批号
          multi: "0", //多图
          showother: "1", //显示非累计点
          gtype: "0", //0所有点 、1最后点、 2最好点
          queryQclevelCode: [], //用户勾选水平的编码
          queryQclevel: [], //用户 勾选的水平
          queryQclevelarr: [], //用户 勾选的水平及代码
          queryQclevelEnable: [], //允许用户勾选的水平
          queryQclevels: [], // ["水平1", "水平2", "水平3", "水平4", "水平5", "水平6"], //全部水平列表
          rptitemcode: "", //右边所选择的项目
          rptitemname: "", 
          //所有项目标签 选项
          powRet: 0, //质控录入授权
          queryDateAll: [], //起始结束日期
          qcrule: {}, //当前所选择项目的质控规则
          qcruletype: "",
          qcOption: {}, //仪器的质控选项
          QC1_2SALTER: "",
          westgardOption: [
              { label: "Westgard", value: 1 },
              { label: "绝对值", value: 2 },
              { label: "百分比", value: 3 },
              { label: "定性质控", value: 4 },
          ],
          controlstatusList: [
              { label: "失控", value: "0" },
              { label: "在控", value: "1" },
              { label: "警告", value: "9" },
              { label: "未判定", value: null },
          ],
          dgList: [
              { label: "", value: "0" },
              { label: "√", value: "1" },
          ],
          qcsOption: [], //质控评价中，质控品的下拉列表
          //质控评价 button
          appChk: "0", //"1":显示提交评价按钮 "2":显示审核按钮 "0":都不显示
          //以下为质控签名窗口参数
          qcsignDialogVisible: false, //质控签名弹窗
          qcsignDate: ["", ""],
          tableDataQcsign: [], //质控签名
          xTableQcsignCheckAll: { checkAll: false }, //质控签名窗口第一列，选择
          qcsignRptitemcode: "",
          qcsignRptitemcodes: [],
          qcsignBatchno: "",
          qcsignBatchnos: [],
          qcsignChecked: "1", //质控签名窗口 all=全部 0=未审核 1=已审核
          checkflagList: [
              { label: "未审核", value: "0" },
              { label: "已审核", value: "1" },
          ],
          //设定Grid窗口 按回车键跳到下一列
          keyConfig: {
              isArrow: true,
              isDel: true,
              isTab: true,
              isEdit: true,
              editMethod: ({ seq, row, rowIndex, column, columnIndex, cell }) => {},
          },
          //以下为分割条和窗口界面布局参数
          leftwidth: 0,
          rightwidth: 1000,
          topheight: 65,
          bottomheight: 0,
          //设置左边2个窗口的大小
          leftWindowWidth: 250,
          batchWindowHeight: 140,
          rptitemWindowHeight: 280,
          //以下为修改计算结果弹窗
          Valuedialogvisible: false,
          tempqcdata: {},
          oldqcdata: {}, //质控修改结果old数据 用于累计标志及画图标志
          oldtempqcdata: {},
          qcupdatevalue: "",
          qccalupdatevalue: 0,
          qccalupdatesd: 0,
          updatereason: "",
          //失控处理弹窗
          outofcontrolvisible: false,
          qcitem: {},
          parentflag: "",
          //报告备注弹窗
          dialogAdviceVisible: false,
          appendChangeRow: false,
          advicetxt: "",
          tableDataAdvice: [],
          tableDataAdviceall: [],
          loadingAdvice: false,
          txtkind: "全部",
          txtinfoarr: [],
          infortype: -1,
          tempappraise: {},
          option2102: false,
          //以下为质控未判定原因
          slvshowdiagnose: "1",
          bShowUndecidedReson: false,
          floatwinna: "质控未判定诊断",
          floatwincnt: 0,
          floatwinlist: [],
          floatwinmsg: "",
          floatwintype: "",
          activeNames: ["1", "2", "3", "4"],
          catchScroll: true,
          currentIndex: 0,
          tindex: 0,
          nArray: [
              {
                  title: "请选择最少2个水平",
                  vscode: "-1,-1",
                  tindex: -1,
              },
              // {
              //     title: "2 水平1 VS 水平3",
              //     tindex: 1,
              // },
              // {
              //     title: "3 水平2 VS 水平3",
              //     tindex: 2,
              // },
          ],
          pointData: [],
          pointData1: [],
          pointData2: [],
      };
  },
  computed: {
      com_batchWindowHeight: function () {
          return this.batchWindowHeight + "px";
      },
      com_rptitemHeight: function () {
          if (this.allbatch == "1") return "100%";
          return this.rptitemWindowHeight + "px";
          // return "70%";
      },
  },
  //html加载完成之前，执行。执行顺序：父组件-子组件
  created() {
      this.initQuery();
      for (let i = 1; i < 13; i++) {
          // for (let i = 1; i < 7; i++) {
          let val = {
              value: i,
              label: "水平 " + i,
          };
          if (i == 10) val.label = "低";
          if (i == 11) val.label = "中";
          if (i == 12) val.label = "高";
          this.queryQclevels.push(val);
      }
  },
  //.html加载完成后执行。执行顺序：子组件-父组件
  mounted() {
      this.$refs.ScrollMainContent.addEventListener("scroll", this.handleScroll);
      if (this.instrname == "" || this.instrname == null) {
          this.getinstr();
      }
      var echartsTheme = require("../../../common/echarts_theme_shine.json"); // echarts图形的样式配置文件
      // echarts.registerTheme("shine", echartsTheme); // 注册样式
      var echartsid = document.getElementById("lis532Chart-0");
      this.charts = echarts.init(echartsid, "shine");
      // var echartsid = document.getElementById("lis532Chart-1");
      // this.charts1 = echarts.init(echartsid, "shine");
      // var echartsid = document.getElementById("lis532Chart-2");
      // this.charts2 = echarts.init(echartsid, "shine");
      this.$nextTick(() => {
          this.batchWindow_resize();
          let widthTemp = this.$refs.topwindow.offsetWidth; //初始化的宽度偏差
          this.rightwidth = widthTemp - this.leftWindowWidth;
          this.$nextTick(() => {
              this.charts.resize({ width: this.autoWidth, height: this.autoHeight }); //窗口初始化时echart大小可自适应 ;
              //  this.charts1.resize({ width: this.autoWidth, height: this.autoHeight }); //窗口初始化时echart大小可自适应 ;
              //       this.charts2.resize({ width: this.autoWidth, height: this.autoHeight }); //窗口初始化时echart大小可自适应 ;
              this.draw(-1); //初始化时画一个样子出来
              // console.log("mounted");
          });
      });

      //监听echart所在的div的resize事件，自适应大小。在拖动左右大小分隔条的时候起作用
      let echarts0 = this.charts;
      let listener = function () {
          echarts0.resize();
      };
      EleResize.on(echartsid, listener);

      this.charts.on("legendselectchanged", function (e) {
          var option = this.getOption();
          if (e.selected[e.name] == false) {
              option.series[e.name.substring(2) * 2 - 1].data = [];
          } else {
              option.series[e.name.substring(2) * 2 - 1].data = option.series[e.name.substring(2) * 2 - 1].data0;
          }
          this.setOption(option);
      });
  },
  destroyed() {
      if (this.$refs.ScrollMainContent) {
          this.$refs.ScrollMainContent.removeEventListener("scroll", this.handleScroll); // 销毁 scroll 事件
      }
  },
  updated() {},
  watch: {
      // instrId(val) {
      //     this.yq_change(this.instrId, this.instrName);
      // },
  },
  methods: {
      handleScroll(e) {
          if (!this.catchScroll) return;
          let _scrollTop = e.target.scrollTop,
              _article = document.querySelectorAll("div.scroll_title");

          for (let i = 0; i < _article.length; i++) {
              if (_scrollTop + 1 >= _article[i].offsetTop) {
                  this.currentIndex = i;
              }
          }
          //低版本浏览器不支持forEach
          // _article.forEach((item, index) => {
          //     if (_scrollTop + 1 >= item.offsetTop) {
          //         this.currentIndex = index;
          //     }
          // });

          if (e.target.scrollTop + 1 >= e.target.scrollHeight - e.target.offsetHeight) {
              //滚动到最后
              this.currentIndex = _article.length - 1;
          }
      },
      goAnchor(index) {
          var that = this;
          this.currentIndex = index; // 把当前点击时获取的 index 赋值给 currentIndex；如果两者相等，则显示高亮
          this.nArray.forEach((e) => {
              if (e.tindex == index) this.currenttitle = e.title;
          });
          if (this.queryQclevelarr.length >= 2) {
              if (this.currentIndex == 0) {
                  this.xname = this.queryQclevelarr[0].label;
                  this.yname = this.queryQclevelarr[1].label;
              } else if (this.currentIndex == 1) {
                  this.xname = this.queryQclevelarr[0].label;
                  this.yname = this.queryQclevelarr[2].label;
              } else if (this.currentIndex == 2) {
                  this.xname = this.queryQclevelarr[1].label;
                  this.yname = this.queryQclevelarr[2].label;
              }
          }
          this.draw(index);
      },
      //////////////////////////////////////事件/////////////////////////////////////////
      allbatch_change() {
          this.setLocalStorage();
          this.$nextTick(() => {
              if (this.allbatch == "1") {
                  this.getRptitemList("");
              } else {
                  this.getBatchList();
              }
          });
      },
      setLocalStorage() {
          let jsondate = {
              allbatch: this.allbatch,
              showallbatch: this.showallbatch,
              gtype: this.gtype,
              //更多操作的选项先不添加了 避免误勾选后，找不到了。
              // slvshownum: this.slvshownum,
              // slvshowdiagnose: this.slvshowdiagnose,
          };
          let modListJson = JSON.stringify(jsondate);
          if (localStorage.getItem("rm_Qmod_OFF125") != "" && localStorage.getItem("rm_Qmod_OFF125") != null) localStorage.removeItem("rm_button_LIS532");
          localStorage.setItem("rm_button_LIS532", modListJson);
      },
      getLoccalStorage() {
          let obj = localStorage.getItem("rm_button_LIS532");
          if (obj != null && obj != "") {
              let jsondate = JSON.parse(obj);
              this.allbatch = jsondate.allbatch;
              this.showallbatch = jsondate.showallbatch;
              this.gtype = jsondate.gtype;
              // this.slvshownum = jsondate.slvshownum;
              // this.slvshowdiagnose = jsondate.slvshowdiagnose;
          }
      },
      //左边 rptitem窗口大小
      batchWindow_resize() {
          this.rptitemWindowHeight = this.$refs.lis532righttab.$el.offsetHeight - this.batchWindowHeight - 8;
      },

      //切换日期
      queryDate_change(type) {
          this.yq_change(this.instrId, this.instrName, type);
      },
      //切换仪器时
      yq_change(id, name, type) {
          this.instrId = id;
          this.instrName = name;
          this.floatwinlist = [];
          this.bShowUndecidedReson = false;
          //if(type ==0) this.slvshownum = "0";
          this.getInputQcPower();
          this.initQclevel(type);
          this.getBatchList();
          this.getpower();
      },
      getpower() {
          this.$tool
              .request({
                  url: "LIS/LIS5/LIS532",
                  method: "post",
                  data: {
                      action: "getpower",
                      instrId: this.instrId,
                  },
              })
              .then((res) => {
                  if (res && res.option2102) {
                      this.option2102 = res.option2102 == "1" ? true : false;
                  } else this.option2102 = false;
              })
              .catch((error) => {
                  this.$alert(error, "错误");
                  this.option2102 = false;
              });
      },
      setnArray() {
          this.nArray = [];
          if (this.queryQclevelarr.length == 2) {
              this.nArray = [
                  {
                      title: this.queryQclevelarr[0].label + " VS " + this.queryQclevelarr[1].label,
                      vscode: this.queryQclevelarr[0].value + "," + this.queryQclevelarr[1].value,
                      tindex: 0,
                  },
              ];
          } else if (this.queryQclevelarr.length >= 3) {
              this.nArray = [
                  {
                      title: this.queryQclevelarr[0].label + " VS " + this.queryQclevelarr[1].label,
                      vscode: this.queryQclevelarr[0].value + "," + this.queryQclevelarr[1].value,
                      tindex: 0,
                  },
                  {
                      title: this.queryQclevelarr[0].label + " VS " + this.queryQclevelarr[2].label,
                      vscode: this.queryQclevelarr[0].value + "," + this.queryQclevelarr[2].value,
                      tindex: 1,
                  },
                  {
                      title: this.queryQclevelarr[1].label + " VS " + this.queryQclevelarr[2].label,
                      vscode: this.queryQclevelarr[1].value + "," + this.queryQclevelarr[2].value,
                      tindex: 2,
                  },
              ];
          } else {
              this.nArray = [
                  {
                      title: "请选择最少2个水平",
                      vscode: "-1,-1",
                      tindex: -1,
                  },
              ];
          }
          this.goAnchor(0);
      },
      //水平切换
      qclevel_change() {
          this.getData();
      },
      //批号切换
      batch_change({ row }, event) {
          //console.log("event", event);
          //TODO ckj 此处欠功能：  切换批号时，项目保持不变
          if (this.allbatch == "0") this.getRptitemList(row.batchno);
      },
      // 勾选批号时
      batch_selectChange({ row }) {
          let batchno = this.getQueryBatch();
          this.getRptitemList(batchno);
      },
      //左边项目切换
      rptitem_change({ row }) {
          this.rptitemcode = row.rpt_itemcode;
          this.rptitemname = row.rpt_itemname;
          this.getData();
      },
      //右边标签切换
      tab_changed(tab, event) {
          var a = tab.value;
          if (tab.paneName == "0") {
              //图形
              this.$nextTick(() => {
                  this.charts.resize({
                      width: this.autoWidth,
                      height: this.autoHeight,
                  }); //可自适应 ;
              });
          }
          if (tab.paneName == "1") {
              //有效数据
              this.showDataKey++;
          }
          if (tab.paneName == "2") {
              //所有数据
              this.fullDataKey++;
          }
          if (tab.paneName == "3") {
              //质控评价数据 切换标签时强制渲染会导致刚输入的数据丢失。
              this.appraiseDataKey++;
          }
      },

      //结果时间更改事件
      resultdtChange(val, row) {
          // console.log("🤣 ~ row", row);
          row.qcdate = XEUtils.toDateString(val, "yyyy-MM-dd");
          var qcdate = row.qcdate;
          var AddIndex = 0;
          var indexdata = this.$refs.xTableAll.getTableData().fullData.filter((item) => XEUtils.toDateString(item.qcdate, "yyyy-MM-dd") == qcdate);
          // console.log("🤣 ~ indexdata", indexdata);
          if (indexdata.length > 1) {
              XEUtils.sortBy(indexdata, ["qcvaluesign"]);
              AddIndex = indexdata[indexdata.length - 2].qcvaluesign - 0;
              // console.log("🤣 ~ indexdata[indexdata.length - 1].qcvaluesign", indexdata[indexdata.length - 1].qcvaluesign);
              // console.log("🤣 ~ AddIndex", AddIndex);
          } else {
              AddIndex = 0;
          }
          row.qcvaluesign = ++AddIndex;
      },
      //初始化查询窗口
      initQuery() {
          this.queryDate = ["", ""];
          let day1 = new Date(); //起始结束日期
          //7天前作为起始日期
          //this.queryDate[0] = XEUtils.toDateString(day1.setDate(day1.getDate() - 7), "yyyy-MM-dd");
          // this.queryDate[0] = XEUtils.toDateString(XEUtils.getWhatDay(new Date(), -180), "yyyy-MM-dd")
          this.queryDate[0] = XEUtils.toDateString(new Date(), "yyyy-MM-01");
          this.queryDate[1] = XEUtils.toDateString(new Date(), "yyyy-MM-dd");
          this.queryDateAll[0] = this.queryDate[0];
          this.queryDateAll[1] = this.queryDate[1];
      },
      async getinstr() {
          try {
              const res = await this.$tool.request({
                  url: "ucent/ddl",
                  method: "post",
                  data: {
                      action: "instrument",
                  },
              });
              var instr = res.RData;
              instr.Data.forEach((e) => {
                  if (e.instrid == this.instrId) {
                      this.instrName = e.instrname;
                  }
              });
              this.getLoccalStorage();
          } catch (e) {
              this.$message.warning(e);
          }
      },
      //查询条件校验
      queryCheck() {
          let msg;
          msg = this.valid(this.instrId, "请选择仪器！"); //仪器校验
          if (msg) return false;
          msg = this.valid(this.queryDate[0], "开始日期 必须填写！"); //时间校验
          if (msg) return false;
          msg = this.valid(this.queryDate[1], "结束日期 必须填写！");
          if (msg) return false;

          return true;
      },
      //初始化结果界面
      resetData() {
          this.queryQclevel = [];
          this.queryQclevelEnable = [];
          this.qcOption = {};
          this.QC1_2SALTER = "";
          this.resetData1();
      },
      resetData1() {
          this.tableDataBatch = [];
          this.resetData2();
      },
      resetData2() {
          this.batchno = "";
          this.tableDataRptitem = [];
          this.rptitemAll = [];
          this.rptitemAllSelect = "";
          this.resetData3();
      },
      resetData3() {
          this.tableDataFull = [];
          this.monthNormalData = [];
          this.cumNormalData = [];
          this.tableDataShow = [];
          this.tableDataLines = [];
          this.tableDataLinesunion = [];
          this.tableAppraiseData = [];
          this.tableDataOutcontrol = [];
          this.drawpointData = [];
          this.qcsOption = [];
          this.tableDataAll = [];
          this.qcrule = {};
          this.charts.clear(); //此处可清空原数据，或用 this.charts.setOption({option},true)
          this.drawTitleText = ""; //上面clear好像清空不了这个
          this.queryDateAll[0] = this.queryDate[0];
          this.queryDateAll[1] = this.queryDate[1];

          this.qclevelAllSelect = "";
          this.draw(-1); //画一个空的图形，避免白板
      },
      btnPrintData(type) {
          var printdata = [];
          // var printuser = this.$tool.getSession(this.$tool.loginusername);
          var colrow = { qcdate: "日期", seq: "序号", rptitem: this.rptitemname };
          for (var k = 0; k < this.queryQclevels.length; k++) {
              colrow["val" + k] = "测定值(" + this.queryQclevels[k].label + ")";
              colrow["sd" + k] = "SD(" + this.queryQclevels[k].label + ")";
          }
          printdata.push(colrow);
          for (var i = 0; i < this.tableDataShow.length; i++) {
              var currstr = {};
              currstr.qcdate = this.tableDataShow[i].qcdate;
              currstr.seq = this.tableDataShow[i].seq;
              // if (this.queryQclevels.length < 7) {
              //     for (var j = 0; j <= 6; j++) {
              if (this.queryQclevels.length < 13) {
                  for (var j = 0; j <= 12; j++) {
                      currstr["val" + j] = this.queryQclevels[j] && this.queryQclevels[j].value != "" && !XEUtils.isUndefined(this.queryQclevels[j].value) ? this.tableDataShow[i]["val" + this.queryQclevels[j].value] : "";
                      currstr["sd" + j] = this.queryQclevels[j] && this.queryQclevels[j].value != "" && !XEUtils.isUndefined(this.queryQclevels[j].value) ? this.tableDataShow[i]["sd" + this.queryQclevels[j].value] : "";
                  }
              }
              printdata.push(currstr);
          }
          var columns = [];
          for (let i = 0; i < 9; i++) {
              columns.push({ title: "项目", property: "rptitem" });
              columns.push({ title: "打印人", property: "printuser" });
              if (i == 0) {
                  columns.push({ title: "日期", property: "qcdate" });
              } else if (i == 1) {
                  columns.push({ title: "序号", property: "seq" });
              } else if (i > 1) {
                  columns.push({ title: "val" + (i - 2), property: "val" + (i - 2) });
                  columns.push({ title: "sd" + (i - 2), property: "sd" + (i - 2) });
              }
          }
          let str = JSON.stringify(columns);
          str += "\r";
          str += JSON.stringify(printdata);
          let sql = btoa(encodeURIComponent(str));
          //console.log("print", res.print, columns);
          if (type == "design") jsObj.SetCustomJsonPrintConfig("5066", sql, "admin", "LIS532");
          else if (type == "print") jsObj.PrintCustomJsonReport("5066", sql, "admin", "LIS532", "");
      },
      //刷新可使用的水平
      initQclevel(type) {
          if (this.queryCheck() === false) return;
          this.$tool
              .request({
                  url: "LIS/LIS5/LIS532",
                  method: "post",
                  data: {
                      action: "initQclevel",
                      instrId: this.instrId,
                      queryDate1: this.queryDate[0],
                      queryDate2: this.queryDate[1],
                  },
              })
              .then((response) => {
                  var data = response.Data;
                  this.queryQclevels = [];
                  this.queryQclevel = [];
                  this.queryQclevelarr = [];
                  this.queryQclevelEnable = [];
                  this.qcOption = response.qcOption;
                  // if (this.qcOption.SINGLELEVELSHOWNUM == "1" && type ==0) this.slvshownum = "1";
                  if (this.qcOption.HOSPITALNA != null && this.qcOption.HOSPITALNA != "") this.hospitalname = this.qcOption.HOSPITALNA;
                  else this.hospitalname = this.qcOption.HOSPITALNAME;
                  this.printQcFilecode = this.qcOption.QCPRINTFILECODE;
                  var printcol = XEUtils.toNumber(this.qcOption.QCDATACOL);
                  var printrow = XEUtils.toNumber(this.qcOption.QCDATAROW);
                  if (printcol > 20) this.printQcdataLen = 20;
                  else if (printcol < 10) this.printQcdataLen = 10;
                  else this.printQcdataLen = printcol;
                  if (printrow > 5) this.printQcdataRow = 5;
                  else if (printrow < 1) this.printQcdataRow = 1;
                  else this.printQcdataRow = printrow;
                  if (this.qcOption.RENAMECURRENTCONTROL != "") this.renamecurrentcontrol = this.qcOption.RENAMECURRENTCONTROL;
                  else this.renamecurrentcontrol = "当前在控";
                  this.QC1_2SALTER = response.qcOption.QC1_2SALTER;
                  var QCPRINTFOOTTEXTGLOBAL = this.qcOption.QCPRINTFOOTTEXTGLOBAL; //从全局参数获取页尾的显示文
                  if (this.qcOption.QCXAXISINTERVAGLOBAL > 0) this.echartsAxisInterval = this.qcOption.QCXAXISINTERVAGLOBAL; //质控图的X轴，最多显示多少个日期
                  if (QCPRINTFOOTTEXTGLOBAL.trim().length > 0) {
                      let arr = QCPRINTFOOTTEXTGLOBAL.split(",");
                      this.printQcFooter[0] = "打印：" + arr[0];
                      if (arr[0]) this.printQcFooter[0] = "打印：" + arr[0];
                      if (arr[1] || arr[1] == "") {
                          if (arr[1] == "") {
                              this.printQcFooter[1] = " ";
                          } else {
                              this.printQcFooter[1] = this.$pub.cutText(arr[1], 24);
                          }
                      }
                      //  if (arr[2] && arr[2] != "") {
                      if (arr[2] || arr[2] == "") {
                          if (arr[2] == "") {
                              this.printQcFooter[2] = " ";
                          } else {
                              this.printQcFooter[2] = this.$pub.cutText(arr[2], 24);
                          }
                      }
                  } else {
                      this.printQcFooter[0] = "操作者：";
                      this.printQcFooter[1] = "核对者：";
                      this.printQcFooter[2] = "主管签名：";
                  }
                  for (var i = 0; i < data.length; i++) {
                      // this.queryQclevelEnable[i] = data[i].val;
                      // this.queryQclevel[i] = data[i].val;
                      let val = {
                          value: data[i].val,
                          label: data[i].na,
                      };
                      this.queryQclevels.push(val);
                      this.queryQclevelEnable.push(val);
                      if (i < 3) this.queryQclevel.push(val.label);
                      if (i < 3) this.queryQclevelarr.push(val);
                  }
                  this.setnArray();
              });
      },
      //设定水平按钮是否允许使用
      setQclevelDisabled(qclevel) {
          for (var i = 0; i < this.queryQclevelEnable.length; i++) {
              if (this.queryQclevelEnable[i].value == qclevel.value) return false;
          }
          return true;
      },
      //根据所选levelname获取level 编号 queryQclevelCode[]
      getQclevelCode(qclevel) {
          this.queryQclevelCode = [];
          this.queryQclevelarr = [];
          for (var i = 0; i < qclevel.length; i++) {
              for (var m = 0; m < this.queryQclevels.length; m++) {
                  if (this.queryQclevels[m].label == qclevel[i]) {
                      this.queryQclevelCode.push(this.queryQclevels[m].value);
                      this.queryQclevelarr.push(this.queryQclevels[m]);
                      continue;
                  }
              }
          }
          this.setnArray();
          // console.log("this.queryQclevelCode", this.queryQclevelCode);
      },
      //根据水平名称，转换为水平编码
      transtQclevel(qclevelName) {
          for (var i = 0; i < this.queryQclevelEnable.length; i++) {
              if (this.queryQclevelEnable[i].label == qclevelName) {
                  return this.queryQclevelEnable[i].value;
              }
          }
          return "";
      },
      //获取左边质控批号列表
      getBatchList() {
          var old_batchno = "";
          if (this.$refs.xTableB) {
              var currentRow = this.$refs.xTableB.getCurrentRow();
              if (currentRow) {
                  old_batchno = currentRow.batchno;
              }
          }
          this.resetData1();
          if (this.queryCheck() === false) return;
          this.getDataByAjax(
              {
                  url: "LIS/LIS5/LIS532",
                  method: "post",
                  data: {
                      action: "getBatchList",
                      instrId: this.instrId,
                      queryDate1: this.queryDate[0],
                      queryDate2: this.queryDate[1],
                      allbatch: this.allbatch, //0单批号、1多批号、2不分批号
                      showallbatch: this.showallbatch, //显示所有批号
                      showother: this.showother, //显示非累计点
                  },
              },
              "",
              "",
              (data) => {
                  this.tableDataBatch = data;
                  var findIndex = this.tableDataBatch.findIndex((item, index) => item.batchno == old_batchno);
                  if (findIndex > 0) {
                      this.$nextTick(() => {
                          let selectrow = this.$refs.xTableB.getData(findIndex);
                          this.$refs.xTableB.setCurrentRow(selectrow); //高亮行
                          this.$refs.xTableB.scrollToRow(selectrow); //滚动到行
                      });
                  } else {
                      this.loadFirstRow(this.$refs.xTableB, "");
                  }
                  // this.loadFirstRow(this.$refs.xTableB, "");
                  this.$nextTick(() => {
                      let batchno = this.getQueryBatch();
                      this.getRptitemList(batchno);
                  });
              },
              (data) => {
                  //errFunction
              }
          );
      },

      //获取用户选择的查询批号
      getQueryBatch() {
          //不分批号
          if (this.allbatch == "1") {
              return "";
          }
          //单批号
          else if (this.allbatch == "0") {
              var selrow = this.$refs.xTableB.getCurrentRow();
              if (selrow) {
                  return "" + selrow.batchno;
              } else return "-1";
          }
          //批号多选
          else if (this.allbatch == "2") {
              var selectRows = this.$refs.xTableB.getSelectRecords();
              if (selectRows && selectRows.length > 0) {
                  var batchno = "";
                  for (let index in selectRows) {
                      batchno += "," + selectRows[index].batchno;
                  }
                  return batchno.substring(1);
              } else {
                  return "-1";
              }
          }
      },
      //获取左边质控项目列表
      getRptitemList(batchno) {
          var old_rpt_itemcode = "";
          if (this.$refs.xTableR) {
              var currentRow = this.$refs.xTableR.getCurrentRow();
              if (currentRow) {
                  old_rpt_itemcode = currentRow.rpt_itemcode;
              }
          }
          this.resetData2();
          if (batchno == "-1") return;
          if (this.queryCheck() === false) return;

          this.getDataByAjax(
              {
                  url: "LIS/LIS5/LIS532",
                  method: "post",
                  data: {
                      action: "getRptitemList",
                      instrId: this.instrId,
                      queryDate1: this.queryDate[0],
                      queryDate2: this.queryDate[1],
                      allbatch: this.allbatch, //0单批号、1不分批号、2批号多选
                      showallbatch: this.showallbatch, //显示所有批号
                      showother: this.showother, //显示非累计点
                      batchno: batchno,
                      qclevel: this.queryQclevelCode, //水平
                      checkflag: "all",
                  },
              },
              "",
              "",
              (data) => {
                  this.tableDataRptitem = data;
                  this.getRptitemAll(this.tableDataRptitem);
                  var findIndex = this.tableDataRptitem.findIndex((item, index) => item.rpt_itemcode == old_rpt_itemcode);
                  if (findIndex > 0) {
                      this.$nextTick(() => {
                          let selectrow = this.$refs.xTableR.getData(findIndex);
                          this.$refs.xTableR.setCurrentRow(selectrow); //高亮行
                          this.$refs.xTableR.scrollToRow(selectrow); //滚动到行
                      });
                  } else {
                      this.loadFirstRow(this.$refs.xTableR, "");
                  }
                  //this.loadFirstRow(this.$refs.xTableR, "");
                  this.$nextTick(() => {
                      var currentRow = this.$refs.xTableR.getCurrentRow();
                      if (currentRow) {
                          this.rptitemcode = currentRow.rpt_itemcode;
                          this.rptitemname = currentRow.rpt_itemname;
                          this.getData();
                      } else {
                          this.rptitemcode = "";
                          this.rptitemname = "";
                      }
                  });
              },
              (data) => {
                  //errFunction
              }
          );
      },
      //所有项目数据标签中，项目下拉框
      getRptitemAll(tableData) {
          this.rptitemAll = [];
          this.rptitemAllSelect = "";
          if (tableData && tableData.length > 0) {
              tableData.forEach((item) => {
                  let temp = {};
                  temp.key = item.rpt_itemcode;
                  temp.value = item.rpt_itemcode;
                  temp.label = item.rpt_itemname;
                  this.rptitemAll.push(temp);
              });
          }
      },
      //定义右边全部数据标签、签名弹窗中 ，特殊单元格颜色
      getOutcontrolClassname({ row, rowIndex, $rowIndex, column }) {
          if (column.property == "controlstatus" || column.property == "controlstatusna" || column.property == "cp_controlstatus" || column.property == "cp_controlstatusna") {
              if (row.controlstatus == "0") return "lis532outcontrol";
              if (row.controlstatus == null) return "lis532outcontrolNull";
          } else if (["checkflag", "checkdt", "checkuser", "qcdate"].includes(column.property)) {
              //审核标记 审核人，审核日期， 质控日期，若审核过了，则变浅绿色
              if (row.checkflag == "1") return "lis532check";
          }
      },
      //定义右边：有效数据 标签中，失控单元格颜色
      getOutcontrolClassnameShow({ row, rowIndex, $rowIndex, column }) {
          if (column.property.substring(0, 2) == "sd") {
              if (row["controlstatus" + column.property.substring(2)] == "0") return "lis532outcontrol";
          } else if (column.property.substring(0, 3) == "val") {
              if (row["controlstatus" + column.property.substring(3)] == "0") return "lis532outcontrol";
          }
      },
      //以下为质控录入判断
      getInputQcPower() {
          this.$tool
              .request({
                  url: "LIS/LIS5/LIS532",
                  method: "post",
                  data: {
                      action: "getInputQcPower",
                      instrId: this.instrId,
                  },
              })
              .then((res) => {
                  this.powRet = res;
              })
              .catch((error) => {
                  this.$alert(error, "错误");
              });
      },
      //打印表格的样式
      PrintClassName({ row, rowIndex, $rowIndex, column }) {
          if (row.hasOwnProperty("rowname")) {
              if (row.rowname == "日期") return "PrintClass PrintClassHeader";
          }
          if (column.property == "lineTagvalue" || column.property == "lineSd" || column.property == "lineCv") {
              return "PrintClass PrintClassRight";
          } else {
              return "PrintClass";
          }
      },
      PrintClassNameHeader({ row, rowIndex, $rowIndex, column }) {
          return "PrintClass PrintClassHeader";
      },
      infochange({ row }) {
          if (row.txtinfokind == "全部") {
              this.tableDataAdvice = this.tableDataAdviceall;
          } else {
              this.tableDataAdvice = this.tableDataAdviceall.filter((item) => item.txtinfokind == row.txtinfokind);
          }
      },
      //质控评价 current-change
      AppraiseChange({ row }) {},
      //获取定性质控对应的Y轴刻度
      getItemjudgeValue(displayvalue) {
          for (var i = 0; i < this.qcrule.itemjudge.length; i++) {
              if (displayvalue == this.qcrule.itemjudge[i].result_str) {
                  return this.qcrule.itemjudge.length - this.qcrule.itemjudge[i].seq / 10;
                  //return this.qcrule.itemjudge[i].seq / 10;
              }
          }
          return 0;
      },
      //获取右边列表所有数据
      getData() {
          this.bShowUndecidedReson = false;
          this.floatwincnt = 0;
          this.floatwinlist = [];
          this.resetData3();
          if (this.queryCheck() === false) return;
          if (!(this.instrId > 0)) {
              return this.$message({ message: "请选择仪器", type: "warning" });
          }
          let batchno = this.getQueryBatch();
          if (batchno == "-1") {
              return;
          }
          if (this.valid(XEUtils.isNull(this.rptitemcode), "请选择项目")) return msg;
          this.getFullData(batchno);
      },

      getFullData(batchno) {
          this.getQclevelCode(this.queryQclevel);
          this.testmethod = "";
          this.loading = true;
          this.batchno = batchno;
          this.floatwinlist = [];
          this.$tool
              .request({
                  url: "LIS/LIS5/LIS532",
                  method: "post",
                  data: {
                      action: "getFullData",
                      instrId: this.instrId,
                      queryDate1: this.queryDate[0],
                      queryDate2: this.queryDate[1],
                      allbatch: this.allbatch, //0单批号、1不分批号、2批号多选
                      showallbatch: this.showallbatch, //显示所有批号
                      showother: this.showother, //显示非累计点
                      qclevel: this.queryQclevelCode, //水平
                      batchno: batchno,
                      rptitemcode: this.rptitemcode,
                      checkflag: "all",
                  },
              })
              .then((response) => {
                  if (response.errcode == "1") {
                      this.monthNormalData = response.mdata;
                      this.cumNormalData = response.cumdata;
                      this.printcheck = response.printcheck;
                      this.tableDataFull = response.Data;
                      var tempcalcRtn = response.calcRtn;
                      this.floatwincnt = "";
                      this.floatwinmsg = "";
                      if (tempcalcRtn) {
                          this.floatwincnt = tempcalcRtn.Item1;
                          var templist = [];
                          for (var i = 0; i < tempcalcRtn.Item3.length; i++) {
                              var p = {
                                  seq: i + 1,
                                  erromsg: tempcalcRtn.Item3[i].erromsg,
                                  errotype: tempcalcRtn.Item3[i].errotype,
                              };
                              templist.push(p);
                          }
                          this.floatwinlist = templist;
                          // tempcalcRtn.Item3.forEach(e => {
                          //     this.floatwinmsg +=e+"\n";
                          // });
                          if (this.floatwinlist.length > 0 && this.slvshowdiagnose == "1") this.bShowUndecidedReson = true;
                      }
                      this.allDataVisible = "0";
                      this.rptitemAllSelect = this.rptitemcode;
                      this.qcrule = response.qcrule;
                      this.showmonthincontrol = response.showmonthincontrol;
                      this.showcumcontrol = response.showcumcontrol;
                      this.qcrule.itemjudge = XEUtils.sortBy(this.qcrule.itemjudge, ["seq"]);
                      this.tableAppraiseData = response.appraiseData;
                      this.$nextTick(() => {
                          this.getTableDataShow();
                      });
                      this.splitLineColor = response.lineColor;
                      this.testmethod = response.testmethod;
                  }
              });

          this.loading = false;
      },

      //// 处理 有效数据标签 （this.tableDataShow 数据）
      getTableDataShow() {
          this.setLocalStorage();
          this.tableDataShow = [];
          //this.tableDataLines = [];
          var tableDataShowTemp = []; //中转下，避免一直渲染
          var lineName = "";
          var lineNameOld = "";
          var lineIndex = 0;
          var index = 0;
          var dataCnt = 0;
          var newLine = false;
          var changeBatch = 0;
          for (var i = 0; i < this.tableDataFull.length; i++) {
              // //获取质控评价的qcid
              let findQcid = this.qcsOption.findIndex((item, index) => item.value == this.tableDataFull[i].qcid);
              if (findQcid == -1) {
                  this.qcsOption.push({
                      value: this.tableDataFull[i].qcid,
                      label: this.tableDataFull[i].batchno + " (" + this.tableDataFull[i].qclevel + ") " + this.tableDataFull[i].qcname + " [" + this.tableDataFull[i].qcid + "]",
                  });
              }
              //获取失控数据  tableDataOutcontrol
              if (this.tableDataFull[i].controlstatus == "0") {
                  let tmp = {};
                  tmp.qcdate = this.tableDataFull[i].qcdate;
                  tmp.qclevel = this.tableDataFull[i].qclevel;
                  tmp.outcontroltips = this.tableDataFull[i].outcontroltips;
                  tmp.outcontrolreason = this.tableDataFull[i].outcontrolreason;
                  tmp.outcontroloperation = this.tableDataFull[i].outcontroloperation;
                  tmp.outcontrolresult = this.tableDataFull[i].outcontrolresult;
                  tmp.outtransokresult = this.tableDataFull[i].outtransokresult;
                  tmp.outcontroluser = this.tableDataFull[i].outcontroluser;
                  tmp.outcontroloperatedt = this.tableDataFull[i].outcontroloperatedt;
                  this.tableDataOutcontrol.push(tmp);
              }

              let nextdata = false;
              if (this.tableDataFull[i].controlstatus == null && this.tableDataFull[i].drawflag != "1") continue;
              if (this.qcrule.qcruletype != "4") {
                  if (this.tableDataFull[i].qcitemvalueid == null || this.tableDataFull[i].qcitemvalueid <= 0) continue;
              }
              if (this.tableDataFull[i].drawflag != "1") continue;
              //if (this.tableDataFull[i].inuseflag != "1") continue;
              //if (this.tableDataFull[i].drawflag != "1") continue;
              lineIndex = this.tableDataFull[i].qclevel;
              lineName = "水平" + lineIndex; //lineName内部识别符号，界面不显示
              if (lineName != lineNameOld) {
                  // if (index >= 6) break; // index 取值范围为 1-6
                  if (index >= 12) break; // index 取值范围为 1-6
                  //index 应该可以扩展为无穷数据，但是必须要扩充线条颜色和表示符号，待做。
                  index++;
                  lineNameOld = lineName;

                  dataCnt = 1;
                  newLine = true;
                  changeBatch = 0;
              } else {
                  newLine = false;
                  dataCnt++; //统计数量
              }

              var qcdate = XEUtils.toDateString(this.tableDataFull[i].qcdate, "yyyy-MM-dd");
              var findIndex = -1;
              var seq = 1;
              var findRow;
              while (findIndex >= -1) {
                  //seq排序赋值
                  // console.log("seq");
                  findIndex = tableDataShowTemp.findIndex(
                      (item, index) => item.qcdate == qcdate && index > findIndex //findIndex示例 ckj
                  );

                  if (findIndex == -1) {
                      findRow = {};
                      findRow.qcdate = qcdate;
                      findRow.seq = seq;
                      findRow.level = [];

                      tableDataShowTemp.push(findRow);
                      break;
                  } else {
                      findRow = tableDataShowTemp[findIndex];
                  }
                  var value = tableDataShowTemp[findIndex]["val" + lineIndex];
                  if (this.gtype == "0") {
                      seq++;
                      if (value == null) break;
                      if (findIndex + 1 == tableDataShowTemp.length) {
                          findRow = {};
                          findRow.qcdate = qcdate;
                          findRow.seq = seq;
                          findRow.level = [];
                          tableDataShowTemp.push(findRow);
                          break;
                      }
                  } else if (this.gtype == "1") {
                      break;
                  } else if (this.gtype == "2") {
                      if (Math.abs(this.tableDataFull[i].calculatesd) >= Math.abs(findRow["sd" + lineIndex])) {
                          nextdata = true;
                      }
                      break;
                  }
              }
              if (nextdata) continue;

              if (
                  //去重
                  findRow.level.findIndex((value) => value == this.tableDataFull[i].qclevel) == -1
              ) {
                  findRow.level.push(this.tableDataFull[i].qclevel);
              }

              findRow["val" + lineIndex] = parseFloat(this.tableDataFull[i].calculatevalue); //XEUtils.toFixedString(this.tableDataFull[i].calculatevalue, 4);
              findRow["sd" + lineIndex] = parseFloat(this.tableDataFull[i].calculatesd); //XEUtils.toFixedString(this.tableDataFull[i].calculatesd, 4);
              if (findRow["val" + lineIndex] != 0) {
                  findRow["cv" + lineIndex] = parseFloat(XEUtils.toFixedString((findRow["sd" + lineIndex] * 100) / findRow["val" + lineIndex], 4));
              } else {
                  findRow["cv" + lineIndex] = null;
              }
              if (this.qcrule.qcruletype == "4") {
                  let displayvalue = this.tableDataFull[i].displayvalue;
                  let seq = this.getItemjudgeValue(displayvalue) + 1;
                  if (seq > 0) {
                      findRow["val" + lineIndex] = displayvalue;
                      findRow["sd" + lineIndex] = seq;
                  }
              }
              findRow["display" + lineIndex] = this.tableDataFull[i].displayvalue;
              findRow["rowid" + lineIndex] = this.tableDataFull[i].qcdataid;
              findRow["checkuser" + lineIndex] = this.tableDataFull[i].checkuser;
              findRow["inuse" + lineIndex] = this.tableDataFull[i].inuseflag;
              findRow["time" + lineIndex] = XEUtils.toDateString(this.tableDataFull[i].resultdt, "yyyy-MM-dd HH:mm:ss");
              findRow["qcitemvalueid" + lineIndex] = this.tableDataFull[i].qcitemvalueid;
              findRow["itemvaluesd" + lineIndex] = parseFloat(this.tableDataFull[i].sd); //XEUtils.toFixedString(this.tableDataFull[i].sd, 4);
              findRow["itemvaluecv" + lineIndex] = parseFloat(this.tableDataFull[i].cv); //XEUtils.toFixedString(this.tableDataFull[i].cv, 4);
              findRow["qcname" + lineIndex] = this.tableDataFull[i].qcname;
              findRow["batchno" + lineIndex] = this.tableDataFull[i].batchno;
              findRow["tagvalue" + lineIndex] = this.tableDataFull[i].tagvalue;
              findRow["expriedt" + lineIndex] = XEUtils.toDateString(this.tableDataFull[i].expriedt, "yyyy-MM-dd");
              findRow["qcdate" + lineIndex] = XEUtils.toDateString(this.tableDataFull[i].qcdate, "yyyy-MM-dd");
              findRow["controlstatus" + lineIndex] = this.tableDataFull[i].controlstatus;
              findRow["outcontroltips" + lineIndex] = this.tableDataFull[i].outcontroltips;
              findRow["cp_controlstatus" + lineIndex] = this.tableDataFull[i].cp_controlstatus;
              findRow["cp_outcontroltips" + lineIndex] = this.tableDataFull[i].cp_outcontroltips; 
              findRow["outcontrolreason" + lineIndex] = this.tableDataFull[i].outcontrolreason;
              findRow["outcontroloperation" + lineIndex] = this.tableDataFull[i].outcontroloperation; 
              findRow["outcontrolresult" + lineIndex] = this.tableDataFull[i].outcontrolresult;
              findRow["outtransokresult" + lineIndex] = this.tableDataFull[i].outtransokresult; 
              findRow["comm" + lineIndex] = this.tableDataFull[i].comm;
              ////非累计， 仅画图的点
              let point1 = [];
              if (this.tableDataFull[i].inuseflag != "1") {
                  let xname = qcdate.substring(5) + (findRow.seq > 1 ? "(" + findRow.seq + ")" : "");
                  // //设点
                  // if(1 == 1 )
                  // {
                  //     xname = qcdate.substring(5) ;
                  // }
                  if (this.qcrule.qcruletype == "4") {
                      point1[0] = xname;
                      point1[1] = this.tableDataFull[i].displayvalue;
                  } else {
                      point1[0] = xname;
                      this.tableDataFull[i].calculatesd;
                      if (this.tableDataFull[i].calculatesd > 3.8) {
                          point1[1] = 3.8;
                      } else if (this.tableDataFull[i].calculatesd < -3.8) {
                          point1[1] = -3.8;
                      } else {
                          point1[1] = this.tableDataFull[i].calculatesd;
                      }
                      // point1[1] = Math.abs(this.tableDataFull[i].calculatesd) > 3.8 ? 3.8 : this.tableDataFull[i].calculatesd;
                  }
                  let pointIndex = this.drawpointData.findIndex((item, index) => item.qclevel == this.tableDataFull[i].qclevel);
                  if (!(pointIndex > 0)) {
                      let item = {};
                      item.qclevel = this.tableDataFull[i].qclevel;
                      item.controlstatus = this.tableDataFull[i].controlstatus;
                      item.data = [];
                      this.drawpointData.push(item);
                      pointIndex = this.drawpointData.length - 1;
                  }
                  this.drawpointData[pointIndex].data.push(point1);
              }
              ////
          }
          tableDataShowTemp = XEUtils.sortBy(tableDataShowTemp, ["qcdate", "seq"]);
          this.tableDataShow = tableDataShowTemp;
          this.pointData = [];
          this.pointData1 = [];
          this.pointData2 = [];
          this.tableDataShow.forEach((e) => {
              if (this.queryQclevelarr.length == 2) {
                  this.setPointData(e, 0, 1, this.pointData);
              } else if (this.queryQclevelarr.length >= 3) {
                  this.setPointData(e, 0, 1, this.pointData);
                  this.setPointData(e, 0, 2, this.pointData1);
                  this.setPointData(e, 1, 2, this.pointData2);
              }
          });
          if (this.slvshownum == "1" && this.allbatch == "0" && this.tableDataShow.length > 0 && index == 1) {
              this.singlelevelshownum.tagvalue = tableDataShowTemp[0]["tagvalue" + lineIndex];
              this.singlelevelshownum.sd = tableDataShowTemp[0]["itemvaluesd" + lineIndex];
          }
          this.draw(0); //画图
      },
      setPointData(e, posx, posy, outtable) {
          if (e["sd" + this.queryQclevelarr[posx].value] && e["sd" + this.queryQclevelarr[posy].value] && XEUtils.isNumber(e["sd" + this.queryQclevelarr[posx].value]) && XEUtils.isNumber(e["sd" + this.queryQclevelarr[posy].value])) {
              var px = e["sd" + this.queryQclevelarr[posx].value];
              var py = e["sd" + this.queryQclevelarr[posy].value];
              var showx = px > 4 ? 4 : px < -4 ? -4 : px;
              var showy = py > 4 ? 4 : py < -4 ? -4 : py;
              var nx = this.queryQclevelarr[posx].label;
              var ny = this.queryQclevelarr[posy].label;
              var batchnox = e["batchno" + this.queryQclevelarr[posx].value];
              var batchnoy = e["batchno" + this.queryQclevelarr[posy].value];
              var qcdate = e.qcdate;
              outtable.push({
                  qcdate: qcdate,
                  value: [showx, showy],
                  levelx: nx + "：" + px,
                  levely: ny + "：" + py,
                  batchnox: batchnox,
                  batchnoy: batchnoy,
              });
          }
      },
      //画图
      draw(flag) {
          this.charts.clear();
          var seriesdata = [];
          var textStyle = { color: "rgba(0, 0, 0, .1)", fontSize: 22 };
          if (flag == 0) seriesdata = this.pointData;
          else if (flag == 1) seriesdata = this.pointData1;
          else if (flag == 2) seriesdata = this.pointData2;
          this.getTableDataLinesunion();
          var markLineOpt = {
              silent: true, //true为不启用，这个贼坑
              animation: false,
              label: {
                  show: false,
                  align: "right",
                  fontSize: 14,
                  fontWeight: 650,
              },
              tooltip: {
                  show: false,
              },
              lineStyle: {
                  type: "solid",
                  width: "1",
              },
              data: [
                  [
                      {
                          lineStyle: {
                              normal: {
                                  color: "DimGray",
                              },
                          },
                          onmouseover: false,
                          tooltip: {},
                          coord: [-4, -4],
                          symbol: "none",
                      },
                      {
                          coord: [4, 4],
                          symbol: "none",
                      },
                  ],
              ],
          };
          this.charts.setOption({
              title: [
                  {
                      text: "Youden",
                      textStyle: {
                          fontSize: 23,
                      },
                      left: "center",
                      top: 5,
                  },
                  {
                      text: "Ⅰ",
                      x: "72%",
                      y: "25%",
                      textStyle: textStyle,
                  },
                  {
                      text: "Ⅱ",
                      x: "25%",
                      y: "25%",
                      textStyle: textStyle,
                  },
                  {
                      text: "Ⅲ",
                      x: "25%",
                      y: "65%",
                      textStyle: textStyle,
                  },
                  {
                      text: "Ⅳ",
                      x: "72%",
                      y: "65%",
                      textStyle: textStyle,
                  },
              ],
              grid: [{ width: "80%", height: "78%", bottom: 45 }],
              tooltip: {
                  formatter: function (params, ticket, callback) {
                      var qcdate = params.data.qcdate;
                      var titlex = "<br/>X：";
                      var levelx = "<br/>" + params.data.levelx;
                      var batchnox = "<br/>批号：" + params.data.batchnox;
                      var titley = "<br/>Y：";
                      var levely = "<br/>" + params.data.levely;
                      var batchnoy = "<br/>批号：" + params.data.batchnoy;
                      var label = qcdate + titlex + levelx + batchnox + titley + levely + batchnoy;
                      return label;
                  },
              },
              xAxis: [
                  {
                      gridIndex: 0,
                      min: -4,
                      max: 4,
                      name: this.xname,
                      nameTextStyle: {
                          fontSize: 14,
                          fontWeight: 600,
                          padding: [12, 0, 0, 0], // 四个数字分别为上右下左与原位置距离
                      },
                      splitNumber: 10,
                      axisLabel: {
                          show: true,
                          interval: 0,
                          formatter: function (val) {
                              var val1 = "";
                              if (val == 0) {
                                  val1 = "";
                              } else if (val == -4 || val == 4) {
                                  val1 = "";
                              } else {
                                  val1 = val + "SD";
                              }
                              return val1;
                          },
                      },
                      // axisTick: {
                      //     interval: 0,
                      // },
                      nameLocation: "center",
                  },
              ],
              yAxis: [
                  {
                      gridIndex: 0,
                      min: -4,
                      max: 4,
                      name: this.yname,
                      nameTextStyle: {
                          fontSize: 14,
                          fontWeight: 600,
                          padding: [0, 0, 15, 0], // 四个数字分别为上右下左与原位置距离
                      },
                      splitNumber: 10,
                      axisLabel: {
                          interval: 0,
                          formatter: function (val) {
                              var val1 = "";
                              if (val == 0) {
                                  val1 = "";
                              } else if (val == -4 || val == 4) {
                                  val1 = "";
                              } else {
                                  val1 = val + "SD";
                              }
                              return val1;
                          },
                      },
                      // axisTick: {
                      //     interval: 0,
                      // },
                      nameLocation: "center",
                  },
              ],
              series: [
                  {
                      name: "I",
                      type: "scatter",
                      xAxisIndex: 0,
                      yAxisIndex: 0,
                      data: seriesdata,
                      markLine: markLineOpt,
                      markArea: {
                          silent: true, //true为不启用，这个贼坑
                          // itemStyle: {
                          //     color: "blue",
                          //     borderWidth: 1,
                          //     borderType: 'dashed'
                          // },
                          data: [
                              [
                                  {
                                      itemStyle: {
                                          color: "rgba(255,255,0,0.2)",
                                          borderWidth: 1,
                                          borderType: "dashed",
                                      },
                                      // name: "Male Data Range",
                                      coord: [-4, -4],
                                  },
                                  {
                                      coord: [4, 4],
                                  },
                              ],
                              [
                                  {
                                      itemStyle: {
                                          color: "rgba(255,255,0,0.2)",
                                          borderWidth: 1,
                                          borderType: "dashed",
                                      },
                                      // name: "Male Data Range",
                                      coord: [-3, -3],
                                  },
                                  {
                                      coord: [3, 3],
                                  },
                              ],
                              [
                                  {
                                      itemStyle: {
                                          color: "rgba(0,191,255,0.3)",
                                          borderWidth: 1,
                                          borderType: "dashed",
                                      },
                                      // name: "Male Data Range",
                                      coord: [-2, -2],
                                  },
                                  {
                                      coord: [2, 2],
                                  },
                              ],
                              [
                                  {
                                      itemStyle: {
                                          color: "rgba(0,255,0,0.3)",
                                          borderWidth: 1,
                                          borderType: "dashed",
                                      },
                                      // name: "Male Data Range",
                                      coord: [-1, -1],
                                  },
                                  {
                                      coord: [1, 1],
                                  },
                              ],
                          ],
                      },
                      itemStyle: {
                          normal: {
                              label: {
                                  show: this.bShowRptItemname == "1" ? true : false,
                                  position: "top",
                                  formatter: function (params, ticket, callback) {
                                      var labelname = params.name;
                                      return labelname;
                                  },
                                  //formatter: ["Label Text"].join("\n"),
                              },
                          },
                      },
                  },
              ],
          });
      },

      //生成线条信息(合并模式)
      getTableDataLinesunion() {
          this.tableDataLinesunion = [];
          var lineText = {};
          var dataCnt = 0;
          var qclevel;
          var qclevelOld;
          var qcitemvalueid = 0;
          var numbers = [];
          var normalnums = [];
          var mnmuns = [];
          for (var n = 0; n < this.queryQclevelCode.length; n++) {
              qclevel = this.queryQclevelCode[n];
              // console.log("🚸 111qclevel", qclevel);
              qclevelOld = "";
              if (this.tableDataLinesunion.length > 0) {
                  this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineNum += dataCnt; //上一根线条数量
                  dataCnt = 0;
                  if (this.qcrule.qcruletype == "4") {
                      //定性质控无统计信息
                  } else {
                      //非定性质控才有统计信息
                      //上一根线线条统计信息
                      if (numbers.length > 0) {
                          // console.log("🐘🐘🐘🐘🐘 —— numbers", numbers);
                          let tempvalue;
                          tempvalue = this.$pub.stddevp(numbers);
                          this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineTagvalueunion = tempvalue.avgValue;
                          this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineSdunion = tempvalue.sdValue;
                          this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineCvunion = tempvalue.cvValue;
                      }
                      if (normalnums.length > 0) {
                          let normaltemp = this.$pub.stddevp(normalnums);
                          this.tableDataLinesunion[this.tableDataLinesunion.length - 1].normallineTagvalueunion = normaltemp.avgValue;
                          this.tableDataLinesunion[this.tableDataLinesunion.length - 1].normallineSdunion = normaltemp.sdValue;
                          this.tableDataLinesunion[this.tableDataLinesunion.length - 1].normallineCvunion = normaltemp.cvValue;
                      }
                      numbers = [];
                      normalnums = [];
                      // mnmuns = [];
                  }
              }

              for (var i = 0; i < this.tableDataShow.length; i++) {
                  let lineData = this.tableDataShow[i];
                  if (lineData["inuse" + qclevel] != "1") continue;
                  if (lineData["val" + qclevel] != null) {
                  } else continue;
                  numbers.push(lineData["val" + qclevel]);
                  if (lineData["controlstatus" + qclevel] == "1") {
                      normalnums.push(lineData["val" + qclevel]);
                  }
                  //新线条
                  if (qclevelOld != qclevel) {
                      lineText = {};
                      lineText.lineLevel = qclevel;
                      lineText.lineName = lineData["qcname" + qclevel];
                      lineText.lineBatch = lineData["batchno" + qclevel];
                      lineText.lineTagvalue = lineData["tagvalue" + qclevel];
                      lineText.lineSd = lineData["itemvaluesd" + qclevel];
                      lineText.lineCv = lineData["itemvaluecv" + qclevel];
                      lineText.lineExpriedt = XEUtils.toDateString(lineData["expriedt" + qclevel], "yyyy-MM-dd");
                      lineText.lineComm = "";
                      lineText.lineNum = 1;
                      this.tableDataLinesunion.push(lineText);
                      dataCnt = 0;
                      qclevelOld = qclevel;
                      if (this.qcrule.qcruletype == "4") {
                          lineText.lineComm = lineData["comm" + qclevel];
                      }
                  } else {
                      // //若有更换批号的情况，记录之 "<br> 更换: "+
                      if (lineData["qcitemvalueid" + qclevel] != qcitemvalueid) {
                          if (this.tableDataLinesunion.length > 0) {
                              this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineNum += dataCnt;
                              dataCnt = 0;
                          }
                          this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineBatch += "\n" + "更换: " + lineData["batchno" + qclevel];
                          this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineName += "\n" + "更换: " + lineData["qcname" + qclevel];
                          this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineTagvalue += "\n" + "更换: " + lineData["tagvalue" + qclevel];
                          this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineSd += "\n" + "更换: " + lineData["itemvaluesd" + qclevel];
                          this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineCv += "\n" + "更换: " + lineData["itemvaluecv" + qclevel];
                          this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineExpriedt += "\n" + "更换: " + XEUtils.toDateString(lineData["expriedt" + qclevel], "yyyy-MM-dd");
                          this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineComm += "\n" + XEUtils.toDateString(lineData["qcdate" + qclevel], "yyyy-MM-dd") + "更换批号/靶值 ";
                      }
                      dataCnt++;
                  }
                  qcitemvalueid = lineData["qcitemvalueid" + qclevel];
              }
          }
          //循环完毕后，附加最后的数据
          if (this.tableDataLinesunion.length > 0) {
              this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineNum += dataCnt; //上一个线
              if (this.qcrule.qcruletype == "4") {
                  //定性质控无统计信息
              } else {
                  //非定性质控才有统计信息
                  if (numbers.length > 0) {
                      let tempvalue;
                      tempvalue = this.$pub.stddevp(numbers);
                      this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineTagvalueunion = tempvalue.avgValue;
                      this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineSdunion = tempvalue.sdValue;
                      this.tableDataLinesunion[this.tableDataLinesunion.length - 1].lineCvunion = tempvalue.cvValue;
                  }
                  // console.log("🤣 ~ normalnums", normalnums);
                  if (normalnums.length > 0) {
                      let normaltemp = this.$pub.stddevp(normalnums);
                      this.tableDataLinesunion[this.tableDataLinesunion.length - 1].normallineTagvalueunion = normaltemp.avgValue;
                      this.tableDataLinesunion[this.tableDataLinesunion.length - 1].normallineSdunion = normaltemp.sdValue;
                      this.tableDataLinesunion[this.tableDataLinesunion.length - 1].normallineCvunion = normaltemp.cvValue;
                  }
                  if (this.monthNormalData.length > 0) {
                      this.queryQclevelCode.forEach((e) => {
                          mnmuns = [];
                          this.monthNormalData.forEach((a) => {
                              if (e == a.qclevel) {
                                  mnmuns.push(a.calculatevalue);
                              }
                          });
                          if (mnmuns.length > 0) {
                              let mntemp = this.$pub.stddevp(mnmuns);
                              this.tableDataLinesunion.forEach((b) => {
                                  if (b.lineLevel == e) {
                                      b.mnlineTagvalueunion = mntemp.avgValue;
                                      b.mnlineSdunion = mntemp.sdValue;
                                      b.mnlineCvunion = mntemp.cvValue;
                                  }
                              });
                          }
                      });
                  }
                  if (this.cumNormalData.length > 0) {
                      this.queryQclevelCode.forEach((e) => {
                          var tempdata = []; //同水平的所有数据
                          this.cumNormalData.forEach((a) => {
                              if (e == a.qclevel) {
                                  var p = {
                                      qclevel: a.qclevel,
                                      batchno: a.batchno,
                                      calculatevalue: a.calculatevalue,
                                  };
                                  tempdata.push(p);
                              }
                          });
                          // console.log("🤣 ~ tempdata", tempdata);
                          if (tempdata.length > 0) {
                              var currbatch = "";
                              var lastbatch = "";
                              var numarr = [];
                              var valuestr = "";
                              var sdstr = "";
                              var cvstr = "";
                              for (var b = 0; b < tempdata.length; b++) {
                                  // console.log("🤣 ~ tempdata", tempdata);
                                  currbatch = tempdata[b].batchno;
                                  if (lastbatch == "") numarr.push(tempdata[b].calculatevalue); //首条
                                  if (lastbatch == currbatch) {
                                      numarr.push(tempdata[b].calculatevalue);
                                  } else {
                                      //发现不同批号,先把上一批号的计算
                                      if (lastbatch != "") {
                                          let cumtmp = this.$pub.stddevp(numarr);
                                          valuestr += "\n" + lastbatch + ":" + cumtmp.avgValue;
                                          sdstr += "\n" + lastbatch + ":" + cumtmp.sdValue;
                                          cvstr += "\n" + lastbatch + ":" + cumtmp.cvValue;
                                          //清空上批计算的数据
                                      }
                                      numarr = [];
                                      numarr.push(tempdata[b].calculatevalue);
                                  }
                                  if (b == tempdata.length - 1) {
                                      //最后一条计算
                                      let cumtmp = this.$pub.stddevp(numarr);
                                      valuestr += "\n" + currbatch + ":" + cumtmp.avgValue;
                                      sdstr += "\n" + currbatch + ":" + cumtmp.sdValue;
                                      cvstr += "\n" + currbatch + ":" + cumtmp.cvValue;
                                  }

                                  lastbatch = currbatch;
                              }
                              if (valuestr != "" && sdstr != "" && cvstr != "") {
                                  valuestr = valuestr.substring(1);
                                  sdstr = sdstr.substring(1);
                                  cvstr = cvstr.substring(1);
                                  this.tableDataLinesunion.forEach((c) => {
                                      if (c.lineLevel == e) {
                                          c.cumlineTagvalueunion = valuestr;
                                          c.cumlineSdunion = sdstr;
                                          c.cumlineCvunion = cvstr;
                                      }
                                  });
                              }
                          }
                      });
                  }
              }
          }
      },
      getTableDataLinesPromise() {
          return new Promise((s, f) => {
              this.$tool
                  .request({
                      url: "LIS/LIS5/LIS532",
                      method: "post",
                      data: {
                          action: "queryLinesData",
                          instrId: this.instrId,
                          queryDate1: this.queryDate[0],
                          queryDate2: this.queryDate[1],
                          allbatch: this.allbatch, //0单批号、1不分批号、2批号多选
                          showallbatch: this.showallbatch, //显示所有批号
                          showother: this.showother, //显示非累计点
                          qclevel: this.queryQclevelCode, //水平
                          batchno: this.batchno,
                          rptitemcode: this.rptitemcode,
                      },
                  })
                  .then((res) => {
                      if (res.errcode == "1") {
                          s(res);
                      } else {
                          f(res);
                      }
                  })
                  .catch((error) => {
                      f(error);
                  });
          });
      },
      //生成图形下方，线条的信息（表格形式展现）
      async getTableDataLines() {
          const res = await this.getTableDataLinesPromise();
          this.tableDataLines = [];
          var lineText = {};
          var dataCntLine = 0;
          var dataCnt = 0;
          var qclevel;
          var qclevelOld;
          var qcitemvalueid = 0;
          var numbers = [];
          this.printInusedata = [];
          this.printILastmonthdata = [];
          this.printInusedata = res.inusedata;
          this.printILastmonthdata = res.lastmonthdata;
          for (var n = 0; n < this.queryQclevelCode.length; n++) {
              qclevel = this.queryQclevelCode[n];
              qclevelOld = "";

              if (this.tableDataLines.length > 0) {
                  this.tableDataLines[this.tableDataLines.length - 1].lineNum = dataCnt; //上一根线条数量
                  dataCnt = 0;
                  if (this.qcrule.qcruletype == "4") {
                      //定性质控无统计信息
                  } else {
                      //非定性质控才有统计信息
                      //上一根线线条统计信息
                      if (numbers.length > 0) {
                          let tempvalue;
                          tempvalue = this.$pub.stddevp(numbers);
                          lineText = {};
                          lineText.lineLevel = "";
                          lineText.lineName = "";
                          lineText.lineBatch = "当前数据";
                          lineText.lineTagvalue = tempvalue.avgValue;
                          lineText.lineSd = tempvalue.sdValue;
                          lineText.lineCv = tempvalue.cvValue;
                          lineText.lineExpriedt = "";
                          lineText.lineComm = "";
                          lineText.lineNum = dataCntLine;
                          this.tableDataLines.push(lineText);
                          this.addLinesData(this.queryQclevelCode[n - 1]);
                      }
                      numbers = [];
                  }
              }

              for (var i = 0; i < this.tableDataShow.length; i++) {
                  let lineData = this.tableDataShow[i];
                  if (lineData["inuse" + qclevel] != "1") continue;
                  if (lineData["val" + qclevel] != null) {
                  } else continue;
                  numbers.push(lineData["val" + qclevel]);
                  //新线条
                  if (qclevelOld != qclevel) {
                      lineText = {};
                      lineText.lineLevel = qclevel;
                      lineText.lineName = lineData["qcname" + qclevel];
                      lineText.lineBatch = lineData["batchno" + qclevel];
                      if (this.qcrule.qcruletype == "4") {
                          lineText.lineTagvalue = "";
                          lineText.lineSd = "";
                          lineText.lineCv = "";
                      } else {
                          lineText.lineTagvalue = lineData["tagvalue" + qclevel];
                          lineText.lineSd = lineData["itemvaluesd" + qclevel];
                          lineText.lineCv = lineData["itemvaluecv" + qclevel];
                      }
                      lineText.lineExpriedt = XEUtils.toDateString(lineData["expriedt" + qclevel], "yyyy-MM-dd");
                      lineText.lineComm = "";
                      if (this.qcrule.qcruletype == "4") {
                          lineText.lineComm = lineData["comm" + qclevel];
                      }
                      lineText.lineNum = "";
                      this.tableDataLines.push(lineText);
                      dataCnt = 1;
                      dataCntLine = 1;
                      qclevelOld = qclevel;
                  } else {
                      // //若有更换批号的情况，记录之
                      if (lineData["qcitemvalueid" + qclevel] != qcitemvalueid) {
                          if (this.tableDataLines.length > 0) {
                              this.tableDataLines[this.tableDataLines.length - 1].lineNum = dataCnt;
                              dataCnt = 0;
                          }
                          let lineText = {};
                          lineText.lineLevel = qclevel;
                          lineText.lineName = lineData["qcname" + qclevel];
                          lineText.lineBatch = lineData["batchno" + qclevel];
                          if (this.qcrule.qcruletype == "4") {
                              lineText.lineTagvalue = "";
                              lineText.lineSd = "";
                              lineText.lineCv = "";
                          } else {
                              lineText.lineTagvalue = lineData["tagvalue" + qclevel];
                              lineText.lineSd = lineData["itemvaluesd" + qclevel];
                              lineText.lineCv = lineData["itemvaluecv" + qclevel];
                          }
                          lineText.lineExpriedt = XEUtils.toDateString(lineData["expriedt" + qclevel], "yyyy-MM-dd");
                          lineText.lineComm = XEUtils.toDateString(lineData["qcdate" + qclevel], "yyyy-MM-dd") + "更换批号/靶值";
                          lineText.lineNum = "";
                          this.tableDataLines.push(lineText);
                      }
                      dataCnt++;
                      dataCntLine++;
                  }
                  qcitemvalueid = lineData["qcitemvalueid" + qclevel];
              }
          }
          ////循环完毕后，附加最后的数据
          if (this.tableDataLines.length > 0) {
              if (numbers.length > 0) this.tableDataLines[this.tableDataLines.length - 1].lineNum = dataCnt; //上一个线
              if (this.qcrule.qcruletype == "4") {
                  //定性质控无统计信息
              } else {
                  //非定性质控才有统计信息
                  if (numbers.length > 0) {
                      let lineText = {};
                      let tempValue = this.$pub.stddevp(numbers);
                      lineText.lineLevel = "";
                      lineText.lineName = "";
                      lineText.lineBatch = "当前数据";
                      lineText.lineTagvalue = tempValue.avgValue;
                      lineText.lineSd = tempValue.sdValue;
                      lineText.lineCv = tempValue.cvValue;
                      lineText.lineExpriedt = "";
                      lineText.lineComm = "";
                      lineText.lineNum = dataCntLine;
                      this.tableDataLines.push(lineText);
                      this.addLinesData(qclevel);
                  }
              }
          }
      },
      //加载 累计数据 、 上月数据
      addLinesData(qclevel) {
          var lineText = {};
          lineText.lineLevel = "";
          lineText.lineName = "";
          lineText.lineExpriedt = "";
          lineText.lineComm = "";
          lineText.lineTagvalue = "";
          lineText.lineSd = "";
          lineText.lineCv = "";
          lineText.lineNum = "";
          lineText.lineBatch = "上月数据";

          for (var i = 0; i < this.printILastmonthdata.length; i++) {
              if (this.printILastmonthdata[i]["qclevel"] == qclevel) {
                  if (this.printILastmonthdata[i]["cp_x"]) lineText.lineTagvalue = parseFloat(this.printILastmonthdata[i]["cp_x"].toFixed(4));
                  if (this.printILastmonthdata[i]["cp_sd"]) lineText.lineSd = parseFloat(this.printILastmonthdata[i]["cp_sd"].toFixed(4));
                  if (this.printILastmonthdata[i]["cp_x"] && this.printILastmonthdata[i]["cp_sd"]) {
                      lineText.lineCv = lineText.lineTagvalue != 0 ? (lineText.lineSd * 100) / lineText.lineTagvalue : "";
                      lineText.lineCv = parseFloat(lineText.lineCv.toFixed(4));
                  }
                  if (this.printILastmonthdata[i]["cp_cnt"]) lineText.lineNum = this.printILastmonthdata[i]["cp_cnt"];
              }
          }
          this.tableDataLines.push(lineText);

          var lineText2 = {};
          lineText2.lineLevel = "";
          lineText2.lineName = "";
          lineText2.lineExpriedt = "";
          lineText2.lineComm = "";
          lineText2.lineTagvalue = "";
          lineText2.lineSd = "";
          lineText2.lineCv = "";
          lineText2.lineNum = "";
          lineText2.lineBatch = "累计数据";
          for (var i = 0; i < this.printInusedata.length; i++) {
              if (this.printInusedata[i]["qclevel"] == qclevel) {
                  if (this.printInusedata[i]["cp_x"]) lineText2.lineTagvalue = parseFloat(this.printInusedata[i]["cp_x"].toFixed(4));
                  if (this.printInusedata[i]["cp_sd"]) lineText2.lineSd = parseFloat(this.printInusedata[i]["cp_sd"].toFixed(4));
                  if (this.printInusedata[i]["cp_x"] && this.printInusedata[i]["cp_sd"]) {
                      lineText2.lineCv = lineText2.lineTagvalue != 0 ? (lineText2.lineSd * 100) / lineText2.lineTagvalue : "";
                      lineText2.lineCv = parseFloat(lineText2.lineCv.toFixed(4));
                  }
                  if (this.printInusedata[i]["cp_cnt"]) lineText2.lineNum = this.printInusedata[i]["cp_cnt"];
              }
          }
          this.tableDataLines.push(lineText2);
          // console.log("this.tableDataLines", this.tableDataLines);
      },
      saveCustomColumnData() {}, //禁止xtable缓存上次的设置
      loadCustomColumnData() {}, //禁止xtable自动加载上次的设置
      //显示值更改
      displaychange(val, row) {
          if (val != "" && val != null) {
              if (!isNaN(val)) {
                  row.calculatevalue = parseFloat(val).toFixed(4);
              }
          }
      },
      allDataFormatFun({ cellValue, column }) {
          if (["rpt_itemcode"].includes(column.property)) {
              try {
                  let rpt_item = this.rptitemAll.find((m) => m.value == cellValue);
                  if (rpt_item != undefined && rpt_item != null) {
                      return rpt_item.label;
                  } else {
                      return cellValue;
                  }
              } catch {}
          }
      },
      ///////////////////////////////////工具函数 /////////////////////////////////////////
      getDataByAjax(
          request,
          okMsg,
          errMsg,
          okFunction, // 取得数据后的回调函数
          errFunction // 获取数据失败后回调函数
      ) {
          this.$tool.request(request).then((response) => {
              if (response.errcode == "1") {
                  if (XEUtils.isString(okMsg)) {
                      if (XEUtils.getSize(XEUtils.trim(okMsg)) > 0) {
                          this.$message({
                              message: okMsg,
                              type: "success",
                              showClose: true,
                          });
                      }
                  }
                  if (typeof okFunction == "function") okFunction(response.Data);
              } else {
                  this.$message({
                      dangerouslyUseHTMLString: true,
                      showClose: true,
                      message: errMsg + "<br><br>11详细信息：" + response.errmsg,
                      type: "warning",
                  });
                  if (typeof errFunction == "function") errFunction(response.Data);
              }
          });
      },
      //自动加载表格的第一行，并执行回调函数
      loadFirstRow(xTable, func) {
          if (xTable != undefined) {
              this.$nextTick(() => {
                  // 加载第一行
                  var selectrow = xTable.getData(0);
                  if (selectrow) {
                      xTable.setCurrentRow(selectrow); //高亮行
                      xTable.scrollToRow(selectrow); //滚动到行
                      if (typeof func == "function") func(selectrow);
                  } else {
                      xTable.setCurrentRow(null); //这个不会自动清空
                  }
              });
          }
      },
      //自制必填校验函数，以后待扩展
      valid(obj, message) {
          if (XEUtils.isUndefined(obj)) {
              return this.$message({
                  message: message,
                  type: "warning",
                  showClose: true,
              });
          }
          if (XEUtils.isNull(obj)) {
              return this.$message({
                  message: message,
                  showClose: true,
                  type: "warning",
              });
          }
          if (XEUtils.isString(obj)) {
              if (!XEUtils.getSize(obj) > 0) {
                  return this.$message({
                      message: message,
                      showClose: true,
                      type: "warning",
                  });
              }
          }
          if (XEUtils.isDate(obj)) {
              if (obj < XEUtils.toStringDate("2000-01-01")) {
                  return this.$message({
                      message: message,
                      type: "warning",
                      showClose: true,
                  });
              }
          }
      },
      xTableRCellClassName({ row, column }) {
          return "basecss";
      },
      createBase64(ele) {
          let docEle = ele + " canvas";
          let canvasFixed = document.querySelector(docEle), //获取图表元素
              canvasWidth = canvasFixed.width, //获取图表元素宽度
              canvasHeigth = canvasFixed.heigth, //获取图表元素高度
              canvas2D = canvasFixed.getContext("2d");
          canvas2D.drawImage(canvasFixed, canvasWidth, canvasHeigth);
          return canvasFixed.toDataURL();
      },
      //删除表格行工具//TODO 连续 点删除按钮会有失去焦点的问题待解决
      deleteRow(xTable, tableData) {
          xTable.updateListenter();
          var delrow = xTable.getCurrentRow();
          if (delrow) {
              var alld = xTable.tableFullData;
              var rowindex = alld.indexOf(delrow);
              xTable.remove(delrow);
              // await this.btnSave().then(() => {
              // this.lXTableData.splice(rowindex, 1)
              let havedata = xTable.tableData;
              if (havedata.length > 0) {
                  if (rowindex >= havedata.length) rowindex = havedata.length - 1;
                  let selectrow = havedata[rowindex];
                  xTable.setCurrentRow(selectrow);
              } else {
                  xTable.setCurrentRow(null);
                  this.tableData = {};
              }
          }
      },
      ////以下为分割条控件，指定函数////////////////////////////////////////////////////////////
      yleftmousedown(ev) {
          let that = this;
          let el = ev.target;
          var disX = ev.clientX - el.offsetLeft;
          document.onmousemove = function (ev) {
              var l = ev.clientX - disX;
              if (l < 20) l = 20;
              that.leftwidth = l;
          };
          document.onmouseup = function () {
              document.onmousemove = null;
              document.onmouseup = null;
          };
      },
      yrightmousedown(ev) {
          let that = this;
          let el = ev.target;
          var disX = ev.clientX - el.offsetLeft;
          document.onmousemove = function (ev) {
              var l = ev.clientX - disX;
              let rw = el.parentElement.clientWidth - l;
              if (rw < 20) rw = 20;
              that.rightwidth = rw;
          };
          document.onmouseup = function () {
              document.onmousemove = null;
              document.onmouseup = null;
          };
      },
      xtopmousedown(ev) {
          let that = this;
          let el = ev.target;
          var disY = ev.clientY - el.offsetTop;
          document.onmousemove = function (ev) {
              var l = ev.clientY - disY;
              if (l < 20) l = 20;
              that.topheight = l;
          };
          document.onmouseup = function () {
              document.onmousemove = null;
              document.onmouseup = null;
          };
      },
      xbottommousedown(ev) {
          let that = this;
          let el = ev.target;
          var disY = ev.clientY - el.offsetTop;
          document.onmousemove = function (ev) {
              var l = ev.clientY - disY;
              let bh = el.parentElement.clientHeight - l;
              if (bh < 20) bh = 20;
              that.bottomheight = bh;
          };
          document.onmouseup = function () {
              document.onmousemove = null;
              document.onmouseup = null;
          };
      },
  },
  beforeRouteEnter(to, from, next) {
      next((vm) => {
          let that = vm;
          let altArr = [];
          document.onkeydown = function (e) {
              let key = window.event.keyCode;
              //*组合按键
              if (altArr.length > 0) {
              } else {
                  if (key == 119) {
                      //F8
                      that.getData();
                  } else if (key == 120) {
                      //F9
                      that.qcsign_click();
                  } else if (key == 121) {
                      //F10
                      that.qcprint_click();
                  } else if (key == 122) {
                      //F11
                      that.qcprint_preview_click();
                  } else if (key == 18) {
                      //按下了alt
                      altArr.push(key);
                  }
              }
          };
          document.onkeyup = function (e) {
              let key = window.event.keyCode;
              if (key == 18) {
                  altArr = [];
              }
          };
      });
  },
};
</script>

<style scoped>
.pagetop {
  width: 100%;
  height: 90px;
  display: -webkit-box;
  -webkit-box-pack: left;
  -webkit-box-align: center;
  border: 1px solid #ccc;
  position: absolute;
}

.pagecenter {
  position: absolute;
  width: 100%;
  left: 0;
  top: 75px;
  border: 0px solid #ccc;
  overflow: auto;
}

.pagebottom {
  width: 100%;
  bottom: 0px;
  display: -webkit-box;
  -webkit-box-pack: left;
  -webkit-box-align: center;
  border: 1px solid #ccc;
  position: absolute;
}

.middle-left {
  position: absolute;
  height: 100%;
  left: 0px;
  overflow: auto;
  background-color: aqua;
}

.middle-right {
  position: absolute;
  height: 100%;
  right: 0px;
  bottom: 0px;
  overflow: visible;
}
.middle-center {
  position: absolute;
  height: 100%;
  overflow: auto;
}
.ysplit {
  height: 100%;
  width: 5px;
  position: absolute;
  z-index: 99;
  cursor: col-resize;
}
.xsplit {
  width: 100%;
  height: 5px;
  position: absolute;
  z-index: 99;
  cursor: row-resize;
}
table tr td:nth-child(odd) {
  text-align: right;
  white-space: nowrap;
  font-size: 12px;
}
table tr td:nth-child(even) {
  text-align: left;
}
/*
table tr td:nth-child(1) {
width: 80px;
}
*/
.showDataTable {
  font-size: 12px;
}

.showDataTable tr td {
  padding: 5px 0px 5px 0px;
}
.Printtable tr td {
  border: 1px solid #eee;
  line-height: 15px;
}
.Printtable {
  text-align: center;
  font-size: 12px;
  border: 1px solid #eee;
  border-spacing: 0px;
}
.gray {
  -webkit-filter: grayscale(1);
  -moz-filter: grayscale(1);
  -ms-filter: grayscale(1);
  -o-filter: grayscale(1);
  filter: grayscale(1);
  filter: gray;
}
.tooltipitem {
  margin: 4px;
}
::v-deep .PrintClass .vxe-cell {
  padding: 0 0;
}
/*使用 /deep/ vscode会显示红色错误 */
::v-deep .lis532outcontrol {
  background-color: #ffcccc !important;
}
::v-deep .lis532outcontrolNull {
  background-color: #cccccc !important;
}
::v-deep .lis532check {
  background-color: #ccffcc !important;
}
::v-deep .el-input.is-disabled .el-input__inner {
  color: black;
}
::v-deep.showPrintQcdataClass .vxe-table .vxe-table--body-wrapper,
.vxe-table .vxe-table--footer-wrapper,
.vxe-table .vxe-table--header-wrapper {
  overflow: hidden;
}
::v-deep .vxe-table--header .vxe-header--column {
  border-right: 1px solid #cccccc;
  border-bottom: 1px solid #ccc;
}
::v-deep .rechk {
  background-color: #c0ffc0;
}
::v-deep .print {
  white-space: pre-line;
}
.basecss {
  width: 100%;
  outline: none;
  border-color: rgba(0, 0, 0, 0);
}
.input {
  border-color: rgba(0, 0, 0, 0))
  outline: none;
}
.input:focus {
  border-color: rgba(0, 0, 0, 0))
  outline: none;
}
::v-deep.basecss .el-input {
  border-color: rgba(0, 0, 0, 0) !important;
  background-color: rgba(0, 0, 0, 0) !important;
}
::v-deep.basecss .el-input--small .el-input__inner {
  border-color: rgba(0, 0, 0, 0) !important;
  background-color: rgba(0, 0, 0, 0) !important;
}
::v-deep.basecss .el-input--small .el-input__inner {
  border-color: rgba(0, 0, 0, 0) !important;
  background-color: rgba(0, 0, 0, 0) !important;
}
/* ::v-deep .basecss .el-input .el-input--small .el-input__inner {
  border-color: rgba(0, 0, 0, 0);
  background-color: rgba(0, 0, 0, 0);
} */
::v-deep.input {
  border-style: none;
}
::v-deep .el-radio {
  margin-right: 15px;
}
::v-deep.el-input--suffix .el-input__inner {
  padding-right: 0px;
}
.el-checkbox {
  margin-right: 2px !important;
}
::v-deep .el-checkbox__label {
  padding-left: 2px;
}
::v-deep .el-collapse-item__content {
  padding-bottom: 0px !important;
  font-size: 12px;
}
::v-deep .el-collapse-item__header {
  height: 30px;
  line-height: 30px;
  font-weight: 900;
}
.tabtop {
  width: 100%;
  height: 26px;
  line-height: 26px;
  border-top: 1px solid #ccc;
  border-left: 1px solid #ccc;
  border-right: 1px solid #ccc;
  white-space: nowrap;
}
.tab-title {
  margin: 0;
  font-size: 13px;
  /* margin: 0 1px 0 3px; */
  padding: 0 1px 0 3px;
  font-weight: 600;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

.left_nav {
  width: 100%;
  /* text-align: center; */
  border: 1px solid #ccc;
  height: calc(100% - 30px);
  padding-bottom: 3px;
}
.left_nav div {
  cursor: pointer;
  height: 40px;
  line-height: 40px;
  padding-left: 50px;
}
.left_nav .active {
  background-color: deepskyblue;
}
.scroll_title {
  padding: 0px 0px 0px 0px;
  color: #333333;
  background-color: #d6d9da;
  font-size: 14px;
  font-weight: bold;
}
::v-deep .isActive {
  background-color: #0095d9;
}
.right_content {
  border: 1px solid #ccc;
  text-align: left;
  top: 26px;
  height: calc(100% - 30px);
  width: 100%;
  position: absolute;
  overflow: auto;
}
</style>
